How to Interpret SVD in Text Mining and Topic Analysis
At a glance
- 1. Build the matrix
Place terms in rows and documents in columns, using counts, binary values, or usually TF–IDF weights.
- 2. Factor the matrix
Compute A = UΣVᵀ; singular vectors describe orthogonal directions shared by terms and documents.
- 3. Choose topics
Keep the first k singular components, where large singular values represent the strongest patterns.
- 4. Read the components
Inspect term weights and document coordinates, remembering that signs and scales require careful interpretation.
Singular value decomposition (SVD) is commonly used in text mining through latent semantic analysis (LSA), also called latent semantic indexing in information-retrieval applications. It reduces a large term-document matrix to a smaller set of directions that capture major patterns of word usage.
The key qualification is that an SVD component is not automatically a topic in the probabilistic sense. It is an algebraically defined direction in the data. You interpret it as a topic by examining which terms and documents have large coordinates on that direction.
Start with a term-document matrix
Suppose there are terms and documents. Construct a matrix with
- one row for each term,
- one column for each document, and
- equal to the weight of term in document .
The weights might be raw counts, binary indicators, logarithmically scaled counts, or TF–IDF values. TF–IDF is often preferable because it reduces the influence of words that occur in nearly every document.
For example, with rows representing terms and columns representing documents,
The first and third terms tend to occur together, while the second and fourth terms are more associated with the third document. SVD finds directions that summarize such co-occurrence patterns, even when the exact words differ between documents.
What the SVD factors mean
The SVD of is
For a full SVD:
- contains orthonormal directions in term space;
- is diagonal and contains nonnegative singular values;
- contains orthonormal directions in document space.
If the singular values are ordered as
the first component explains the strongest matrix pattern, the second explains the strongest remaining orthogonal pattern, and so on. This is a statement about matrix approximation, not necessarily about independent real-world causes.
Writing the decomposition as a sum makes the structure clearer:
where is the th column of and is the th column of .
Each component is a rank-one pattern. The vector gives the term-side weights, gives the document-side weights, and gives the overall strength of that pattern.
How a component becomes an interpreted topic
Choose a reduced dimension and retain the first components:
This is the best rank- approximation to under the usual Frobenius-norm and spectral-norm criteria. In practical terms, it smooths the matrix by retaining broad regularities and discarding weaker detail or noise.
To interpret component :
- Inspect the entries of associated with the largest absolute term weights.
- Inspect the entries of the corresponding document vector.
- Give the component a human-readable label only after examining both sets of terms and documents.
The representation of document in the reduced space is the th column of
The row representation of term is the th row of . Some software instead reports and separately, so check whether the singular values have already been multiplied into the coordinates before comparing magnitudes.
Large positive or negative coordinates indicate association with opposite ends of a latent direction. A topic-like component may therefore have positive terms on one side and negative terms on the other. This often means the component contrasts two vocabularies rather than representing one pure subject.
A small exact example
Consider the matrix
The first two rows have the same pattern, and the third row never occurs. The matrix has rank one. Its SVD can be written as
Thus the only nonzero singular value is . The term vector is proportional to , so the first term is twice as prominent as the second in this pattern, while the third term contributes nothing. The document vector is proportional to , so the second document has twice the strength of the first and the third document has none.
In a real corpus, the first component might have large weights for words such as “interest,” “loan,” and “bank,” while documents about finance also receive large coordinates. You could label it a finance-related direction, but that label is your interpretation, not an output guaranteed by SVD.
Choosing the number of topics
There is no universal rule that says to retain exactly components. Common approaches include:
- plotting the singular values and looking for an elbow;
- measuring reconstruction error as increases;
- evaluating retrieval, clustering, or classification performance;
- using a validation set for the downstream task.
The fraction of squared matrix energy retained by the first components is often reported as
This is useful, but it is not automatically the percentage of “topics explained.” It measures how much squared matrix variation is retained.
Common interpretation mistakes
Treating SVD topics as probabilities
SVD weights can be negative and do not generally sum to one. They are not word probabilities. Probabilistic topic models such as latent Dirichlet allocation impose different constraints and have a different interpretation.
Ignoring the weighting scheme
Changing from raw counts to TF–IDF can substantially change the components. Stop-word removal, stemming, vocabulary selection, document-length normalization, and rare-word filtering also affect the result.
Reading only the singular vectors
The singular value matters. If you compare component strengths, use the singular values, and determine whether your software scales or by in its reported coordinates.
Assuming signs have fixed meaning
If is a valid pair, then is equally valid. SVD can reverse the sign of a component between runs or implementations without changing the represented matrix. Interpret relative signs within one component, not the absolute choice of positive versus negative.
Assuming topics are independent
SVD components are orthogonal in the mathematical vector-space sense. Human subjects are not necessarily orthogonal: a document about medical finance can relate to both a health component and an economic component. Orthogonality does not mean the real-world topics are unrelated.
Centering without a reason
For ordinary LSA, the sparse term-document matrix is usually decomposed directly after suitable text weighting. Centering columns, as in some statistical PCA workflows, changes the question and can destroy useful sparsity. Apply centering only when it is justified by the intended analysis.
A practical interpretation is therefore: the th SVD component is a strong, orthogonal pattern of term usage and document usage; its topic label is a human summary of the highest-weight terms and documents.
References
- Introduction to Information Retrieval, Christopher D. Manning, Prabhakar Raghavan, and Hinrich Schütze
- Indexing by Latent Semantic Analysis, Scott Deerwester, Susan Dumais, George Furnas, Thomas Landauer, and Richard Harshman
- Numerical Recipes: The Art of Scientific Computing, William H. Press et al.
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.