liveBook · Manning

Topic vector

As explained in Math and Architectures of Deep Learning

A vector whose entries indicate how strongly each term contributes to a topic.

A topic vector is a column of V whose entries show how strongly the vocabulary terms contribute to one latent topic. In latent semantic analysis, topic vectors provide a lower-dimensional topic space for representing documents. section 4.6.2

Topic vectors support dimensionality reduction through this workflow:

  • Compute principal vectors from the document-term matrix X, using eigenvectors of XᵀX or its covariance matrix. section 4.6.2
  • Use the diagonal values of S as topic-importance weights, choose a cutoff, and discard lower-weight topics by removing columns of V. section 4.6.2
  • Project X onto the retained topic vectors to obtain document representations, then compare documents with cosine similarity in topic space. section 4.6.2

Toy document collection

A document-term matrix includes terms such as “violence,” “gun,” “America,” and “roses.” A topic vector assigns one contribution to each vocabulary term, while projecting documents into the retained topic space can reveal indirect similarities. section 4.6.2

Table 4.1 Document matrix for the toy example dataset

  

Violence

Gun

America

⋯

Roses

d0

0

0

0

⋯

2

d1

1

1

1

⋯

0

d2

2

2

0

⋯

0

d3

3

3

0

⋯

0

d4

5

5

0

⋯

0

d5

0

1

0

⋯

0

d6

1

0

0

⋯

0

Inspect the toy document matrix to see how term counts provide the input from which topic vectors are derived. section 4.6.2

How Math and Architectures of Deep Learning covers it

How deep it goes
Explains term contributions, eigenvector construction, topic weighting, cutoff selection, projection, and cosine similarity.
Examples
Uses a toy document-term matrix containing violence, gun, America, roses, and documents d0 through d6.
What you can do after
Evaluate document relationships by projecting term vectors into a retained topic space and comparing them with cosine similarity.
How it connects
Connects latent semantic analysis, document-term matrices, dimensionality reduction, document vectors, and cosine similarity.

Also explained in

Compare how 2 books explain topic vector →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.