Latent semantic analysis
Encyclopedia : L : LA : LAT : Latent semantic analysis
Latent semantic analysis (LSA) is a technique in natural language processing, in particular in vectorial semantics, invented in 1990 [link] by Scott Deerwester, Susan Dumais, George Furnas, Thomas Landauer, and Richard Harshman. In the context of its application to information retrieval, it is sometimes called latent semantic indexing (LSI).
Occurrence matrix
LSA uses a term-document matrix which describes the occurrences of terms in documents; it is a sparse matrix whose rows correspond to documents and whose columns correspond to terms, typically stemmed words that appear in the documents. A typical example of the weighting of the elements of the matrix is tf-idf: the element of the matrix proportional to the number of times the terms appear in each document, where rare terms are upweighted to reflect their relative importance.This matrix is common to standard semantic models as well (though it is not necessarily explicitly expressed as a matrix, since the mathematical properties of matrix are not always used).
Applications
Your original matrix gives the relationship between terms and documents. Latent semantic analysis transforms this into a relationship between the terms and concepts, and a relation between the documents and the same concepts. The terms and documents are now indirectly related through the concepts.Your new concept space typically lets you do the following:
- Compare your documents in the concept space (data clustering, document classification).
- Find relations between terms (synonymy and polysemy).
- Given a query of terms, translate it into the concept space, and find matching documents (information retrieval).
- In synonymy, different writers use different words to describe the same idea. Thus, a person issuing a query in a search engine may use a different word than appears in a document, and may not retrieve the document.
- In polysemy, the same word can have multiple meanings, so a searcher can get unwanted documents with the alternate meanings
Rank lowering
After the construction of the occurrence matrix LSA finds a low-rank approximation to the term-document matrix. The reasons for the approximations can have various explanations:
- The original term-document matrix is presumed too large for the computing resources; in this point of view, the approximated matrix is interpreted as an approximation (a "least and necessary evil")
- The original term-document matrix is presumed noisy: for instance, anecdotal instances of terms are to be eliminated. From this point of view, the approximated matrix is interpreted as a de-noisified matrix (a better matrix than the original).
- The original term-document matrix is presumed overly sparse relative to the "true" term-document matrix. That is, the original matrix lists only the words actually in each document, whereas we might be interested in all words related to each document--generally a much larger set due to synonymy.
- : -->
Derivation
Let [X] be a matrix where element [(i,j)] describes the occurrence of term [i] in document [j] (this can be for example the frequency). [X] will look like this:[\begin & \textbf_j \\ & \downarrow \\\textbf_i^T \rightarrow &\begin x_ & \dots & x_ \\\vdots & \ddots & \vdots \\x_ & \dots & x_ \\\end\end]
Now a row in this matrix will be a vector corresponding to a term, giving its relation to each document:
[\textbf_i^T = \begin x_ & \dots & x_ \end]
Likewise, the a column in this matrix will be a vector corresponding to a document, giving its relation to each term:
[\textbf_j = \begin x_ \\ \vdots \\ x_ \end]
Now the dot product [\textbf_i^T \textbf_p] between two term vectors gives the correlation between the terms over the documents. The matrix product [X X^T] contains all these dot products. Element [(i,p)] (which is equal to element [(p,i)]) contains the dot product [\textbf_i^T \textbf_p] ([ = \textbf_p^T \textbf_i]). Likewise, the matrix [X^T X] contains the dot products between all the document vectors, giving their correlation over the terms: [\textbf_j^T \textbf_q = \textbf_q^T \textbf_j].
Now assume that there exists a decomposition of [X] such that [U] and [V] are orthonormal matrixes and [\Sigma] is a diagonal matrix. This is called a singular value decomposition:
[X = U \Sigma V^T]
The matrix products giving us the term and document correlations then become.
[\beginX X^T &=& (U \Sigma V^T) (U \Sigma V^T)^T = (U \Sigma V^T) (V^ \Sigma U^T) = U \Sigma V^T V \Sigma U^T = U \Sigma^2 U^T \\X^T X &=& (U \Sigma V^T)^T (U \Sigma V^T) = (V^ \Sigma U^T) (U \Sigma V^T) = V \Sigma U^T U \Sigma V^T = V \Sigma^2 V^T\end]
We see that [U] must contain the eigenvectors of [X X^T], while [V] must be the eigenvectors of [X^T X]. Both products have the same eigenvalues, given by the diagonal matrix [\Sigma^2]. Now the decomposition looks like this:
[\begin & X & & & U & & \Sigma & & V^T \\ & (\textbf_j) & & & & & & & (\hat \textbf_j) \\ & \downarrow & & & & & & & \downarrow \\(\textbf_i^T) \rightarrow &\begin x_ & \dots & x_ \\\\\vdots & \ddots & \vdots \\\\x_ & \dots & x_ \\\end&=&(\hat \textbf_i^T) \rightarrow&\begin \begin \, \\ \, \\ \textbf_1 \\ \, \\ \,\end \dots\begin \, \\ \, \\ \textbf_l \\ \, \\ \, \end\end&\cdot&\begin \sigma_1 & \dots & 0 \\\vdots & \ddots & \vdots \\0 & \dots & \sigma_l \\\end&\cdot&\begin \begin & & \textbf_1 & & \end \\\vdots \\\begin & & \textbf_l & & \end\end\end]
The values [\sigma_1, \dots, \sigma_l] are called the singular values, and [u_1, \dots, u_l] and [v_1, \dots, v_l] the left and right singular vectors. Notice how the only part of [U] that contributes to [\textbf_i] is the [i\textrm] row. Let this row vector be called [\hat \textrm_i]. Likewise, the only part of [V^T] that contributes to [\textbf_i] is the [j\textrm] column, [\hat \textrm_j]. These are not the eigenvectors, but depend on all the eigenvectors.
It turns out that when you select the [k] largest singular values, and their corresponding singular vectors from [U] and [V], you get the rank [k] approximation to X with the smallest error (Frobenius norm). The amazing thing about this approximation, is that not only does it have a minimal error, but it translates the term and document vectors into a concept space. The vector [\hat \textbf_i] then has [k] entries, each giving the occurrence of term [i] in one of the [k] concepts. Likewise, the vector [\hat \textbf_j] gives the relation between document [j] and each concept. We write this approximation as
[X_k = U_k \Sigma_k V_k^T]
You can now do the following:
- See how related documents [j] and [q] are in the concept space by comparing the vectors [\hat \textbf_j] and [\hat \textbf_q] (typically by cosine similarity). This gives you a clustering of the documents.
- Comparing terms [i] and [p] by comparing the vectors [\hat \textbf_j] and [\hat \textbf_p], giving you a clustering of the terms in the concept space.
- Given a query, view this as a mini document, and compare it to your documents in the concept space.
[\textbf_j = U_k \Sigma_k \hat \textbf_j]
[\hat \textbf_j = \Sigma_k^ U_k^T \textbf_j]
This means that if you have a query vector [q], you must do the translation [\hat \textbf = \Sigma_k^ U_k^T \textbf] before you compare it with the document vectors in the concept space. You can do the same for pseudo term vectors:
[\textbf_i^T = \hat \textbf_i^T \Sigma_k V_k^T]
[\hat \textbf_i^T = \textbf_i^T V_k^ \Sigma_k^ = \textbf_i^T V_k \Sigma_k^]
[\hat \textbf_i = \Sigma_k^ V_k^T \textbf_i]
Implementation
The SVD is typically computed using large matrix methods (for example, Lanczos methods) but may also be computed incrementally and with greatly reduced resources via a neural network-like approach which does not require the large, full-rank matrix to be held in memory [link].
Limitations of LSA
LSA features a number of drawbacks:
- The resulting dimensions might be difficult to interpret. For instance, in
- : -->
- the (1.3452 * car + 0.2828 * truck) component could be interpreted as "vehicle". However, it is very likely that cases close to
- : -->
- will occur. This leads to results which can be justified on the mathematical level, but have no interpretable meaning in natural language.
- The probabilistic model of LSA does not match observed data: LSA assumes that words and documents form a joint Gaussian model (ergodic hypothesis), while a Poisson distribution has been observed. Thus, a newer alternative is probabilistic latent semantic analysis, based on a multinomial model, which is reported to give better results than standard LSA.
See also
External links and references
- [the first place to start with LSA]
- [Introduction to Latent Semantic Analysis], by [T. K. Landauer], P. W. Foltz, & D. Laham, Discourse Processes, 25, 259-284 (1998).
- [Indexing by Latent Semantic Analysis], by S. Deerwester, [S. T. Dumais], G. W. Furnas, T. K. Landauer, R. Harshman, Journal of the Society for Information Science, 41(6), 391-407, (1990). Original article where the model was first exposed.
- [Using Linear Algebra for Intelligent Information Retrieval], by M.W. Berry, S.T. Dumais, G.W. O'Brien (1995) [PDF] : Illustration of the application of LSA to document retrieval.
- [InfoVis page on Latent Semantic Analysis]
- [Probabilistic Latent Semantic Analysis], by T. Hofmann, Proc. Uncertainty in Artificial Intelligence, (1999)
- [Generalized Hebbian Algorithm for Latent Semantic Analysis], by Gorrell, G and Webb, B, Proc. Interspeech, (2005)
- [An Open Source LSA Package for R]
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
