Latent semantic analysis
It has been suggested that Latent semantic indexing be merged into this article. (Discuss) Proposed since July 2012.

Semantics  

Computing  


Latent semantic analysis (LSA) is a technique in natural language processing, in particular distributional semantics, of analyzing relationships between a set of documents and the terms they contain by producing a set of concepts related to the documents and terms. LSA assumes that words that are close in meaning will occur in similar pieces of text. A matrix containing word counts per paragraph (rows represent unique words and columns represent each paragraph) is constructed from a large piece of text and a mathematical technique called singular value decomposition (SVD) is used to reduce the number of rows while preserving the similarity structure among columns. Words are then compared by taking the cosine of the angle between the two vectors (or the dot product between the normalizations of the two vectors) formed by any two rows. Values close to 1 represent very similar words while values close to 0 represent very dissimilar words.^{[1]}
An information retrieval technique using latent semantic structure was patented in 1988 (US Patent 4,839,853, now expired) by Scott Deerwester, Susan Dumais, George Furnas, Richard Harshman, Thomas Landauer, Karen Lochbaum and Lynn Streeter. In the context of its application to information retrieval, it is sometimes called Latent Semantic Indexing (LSI).^{[2]}
Contents
Overview
Occurrence matrix
LSA can use a termdocument matrix which describes the occurrences of terms in documents; it is a sparse matrix whose rows correspond to terms and whose columns correspond to documents. A typical example of the weighting of the elements of the matrix is tfidf (term frequency–inverse document frequency): the weight of an element of the matrix is 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 also common to standard semantic models, though it is not necessarily explicitly expressed as a matrix, since the mathematical properties of matrices are not always used.
Rank lowering
After the construction of the occurrence matrix, LSA finds a lowrank approximation^{[3]} to the termdocument matrix. There could be various reasons for these approximations:
 The original termdocument matrix is presumed too large for the computing resources; in this case, the approximated low rank matrix is interpreted as an approximation (a "least and necessary evil").
 The original termdocument matrix is presumed noisy: for example, anecdotal instances of terms are to be eliminated. From this point of view, the approximated matrix is interpreted as a denoisified matrix (a better matrix than the original).
 The original termdocument matrix is presumed overly sparse relative to the "true" termdocument 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.
The consequence of the rank lowering is that some dimensions are combined and depend on more than one term:

 {(car), (truck), (flower)} > {(1.3452 * car + 0.2828 * truck), (flower)}
This mitigates the problem of identifying synonymy, as the rank lowering is expected to merge the dimensions associated with terms that have similar meanings. It also mitigates the problem with polysemy, since components of polysemous words that point in the "right" direction are added to the components of words that share a similar meaning. Conversely, components that point in other directions tend to either simply cancel out, or, at worst, to be smaller than components in the directions corresponding to the intended sense.
Derivation
Let be a matrix where element describes the occurrence of term in document (this can be, for example, the frequency). will look like this:
Now a row in this matrix will be a vector corresponding to a term, giving its relation to each document:
Likewise, a column in this matrix will be a vector corresponding to a document, giving its relation to each term:
Now the dot product between two term vectors gives the correlation between the terms over the documents. The matrix product contains all these dot products. Element (which is equal to element ) contains the dot product (). Likewise, the matrix contains the dot products between all the document vectors, giving their correlation over the terms: .
Now, from the theory of linear algebra, there exists a decomposition of such that and are orthogonal matrices and is a diagonal matrix. This is called a singular value decomposition (SVD):
The matrix products giving us the term and document correlations then become
Since and are diagonal we see that must contain the eigenvectors of , while must be the eigenvectors of . Both products have the same nonzero eigenvalues, given by the nonzero entries of , or equally, by the nonzero entries of . Now the decomposition looks like this:
The values are called the singular values, and and the left and right singular vectors. Notice the only part of that contributes to is the row. Let this row vector be called . Likewise, the only part of that contributes to is the column, . These are not the eigenvectors, but depend on all the eigenvectors.
It turns out that when you select the largest singular values, and their corresponding singular vectors from and , you get the rank approximation to with the smallest error (Frobenius norm). This approximation has a minimal error. But more importantly we can now treat the term and document vectors as a "semantic space". The vector then has entries mapping it to a lowerdimensional space dimensions. These new dimensions do not relate to any comprehensible concepts. They are a lowerdimensional approximation of the higherdimensional space. Likewise, the vector is an approximation in this lowerdimensional space. We write this approximation as
You can now do the following:
 See how related documents and are in the lowdimensional space by comparing the vectors and (typically by cosine similarity).
 Comparing terms and by comparing the vectors and .
 Documents and term vector representations can be clustered using traditional clustering algorithms like kmeans using similarity measures like cosine.
 Given a query, view this as a mini document, and compare it to your documents in the lowdimensional space.
To do the latter, you must first translate your query into the lowdimensional space. It is then intuitive that you must use the same transformation that you use on your documents:
Note here that the inverse of the diagonal matrix may be found by inverting each nonzero value within the matrix.
This means that if you have a query vector , you must do the translation before you compare it with the document vectors in the lowdimensional space. You can do the same for pseudo term vectors:
Applications
The new lowdimensional space typically can be used to:
 Compare the documents in the lowdimensional space (data clustering, document classification).
 Find similar documents across languages, after analyzing a base set of translated documents (cross language retrieval).
 Find relations between terms (synonymy and polysemy).
 Given a query of terms, translate it into the lowdimensional space, and find matching documents (information retrieval).
 Find the best similarity between small groups of terms, in a semantic way (i.e. in a context of a knowledge corpus), as for example in multi choice questions MCQ answering model.^{[4]}
Synonymy and polysemy are fundamental problems in natural language processing:
 Synonymy is the phenomenon where different words describe the same idea. Thus, a query in a search engine may fail to retrieve a relevant document that does not contain the words which appeared in the query. For example, a search for "doctors" may not return a document containing the word "physicians", even though the words have the same meaning.
 Polysemy is the phenomenon where the same word has multiple meanings. So a search may retrieve irrelevant documents containing the desired words in the wrong meaning. For example, a botanist and a computer scientist looking for the word "tree" probably desire different sets of documents.
Commercial applications
LSA has been used to assist in performing prior art searches for patents.^{[5]}
Applications in human memory
The use of Latent Semantic Analysis has been prevalent in the study of human memory, especially in areas of free recall and memory search. There is a positive correlation between the semantic similarity of two words (as measured by LSA) and the probability that the words would be recalled one after another in free recall tasks using study lists of random common nouns. They also noted that in these situations, the interresponse time between the similar words was much quicker than between dissimilar words. These findings are referred to as the Semantic Proximity Effect.^{[6]}
When participants made mistakes in recalling studied items, these mistakes tended to be items that were more semantically related to the desired item and found in a previously studied list. These priorlist intrusions, as they have come to be called, seem to compete with items on the current list for recall.^{[7]}
Another model, termed Word Association Spaces (WAS) is also used in memory studies by collecting free association data from a series of experiments and which includes measures of word relatedness for over 72,000 distinct word pairs.^{[8]}
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 networklike approach, which does not require the large, fullrank matrix to be held in memory.^{[9]} A fast, incremental, lowmemory, largematrix SVD algorithm has recently been developed.^{[10]} MATLAB and Python implementations of these fast algorithms are available. Unlike Gorrell and Webb's (2005) stochastic approximation, Brand's algorithm (2003) provides an exact solution. In recent years progress has been made to reduce the computational complexity of SVD; for instance, by using a parallel ARPACK algorithm to perform parallel eigenvalue decomposition it is possible to speed up the SVD computation cost while providing comparable prediction quality.^{[11]}
Limitations
Some of LSA's drawbacks include:
 The resulting dimensions might be difficult to interpret. For instance, in

 {(car), (truck), (flower)} ↦ {(1.3452 * car + 0.2828 * truck), (flower)}
 the (1.3452 * car + 0.2828 * truck) component could be interpreted as "vehicle". However, it is very likely that cases close to
 {(car), (bottle), (flower)} ↦ {(1.3452 * car + 0.2828 * bottle), (flower)}
 will occur. This leads to results which can be justified on the mathematical level, but have no interpretable meaning in natural language.
 LSA cannot capture polysemy (i.e., multiple meanings of a word)^{[citation needed]}. Each occurrence of a word is treated as having the same meaning due to the word being represented as a single point in space. For example, the occurrence of "chair" in a document containing "The Chair of the Board" and in a separate document containing "the chair maker" are considered the same. The behavior results in the vector representation being an average of all the word's different meanings in the corpus, which can make it difficult for comparison. However, the effect is often lessened due to words having a predominant sense throughout a corpus (i.e. not all meanings are equally likely).
 Limitations of bag of words model (BOW), where a text is represented as an unordered collection of words. To address some of the limitation of bag of words model (BOW), multigram dictionary can be used to find direct and indirect association as well as higherorder cooccurrences among terms.^{[12]}
 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.^{[13]}
See also
 Compound term processing
 Explicit semantic analysis
 Latent semantic mapping
 Latent Semantic Structure Indexing
 Principal components analysis
 Probabilistic latent semantic analysis
 Spamdexing
 Topic model
 Distributional semantics
 CohMetrix
References
 ↑ Susan T. Dumais (2005). "Latent Semantic Analysis". Annual Review of Information Science and Technology. 38: 188. doi:10.1002/aris.1440380105.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
 ↑ "The Latent Semantic Indexing home page".<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
 ↑ Markovsky I. (2012) LowRank Approximation: Algorithms, Implementation, Applications, Springer, 2012, ISBN 9781447122265^{[page needed]}
 ↑ Alain Lifchitz, Sandra JheanLarose, Guy Denhière (2009). "Effect of tuned parameters on an LSA multiple choice questions answering model" (PDF). Behavior Research Methods. 41 (4): 1201–1209. doi:10.3758/BRM.41.4.1201. PMID 19897829.CS1 maint: multiple names: authors list (link)<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
 ↑ Gerry J. Elman (October 2007). "Automated Patent Examination Support  A proposal". Biotechnology Law Report. 26 (5): 435. doi:10.1089/blr.2007.9896<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
 ↑ Marc W. Howard and Michael J. Kahana (1999). "Contextual Variability and Serial Position Effects in Free Recall" (PDF). Cite journal requires
journal=
(help)<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>  ↑ Franklin M. Zaromb; et al. (2006). "Temporal Associations and PriorList Intrusions in Free Recall" (PDF). Cite journal requires
journal=
(help)<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>  ↑ Nelson, Douglas. "The University of South Florida Word Association, Rhyme and Word Fragment Norms". Retrieved May 8, 2011.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
 ↑ Geneviève Gorrell and Brandyn Webb (2005). "Generalized Hebbian Algorithm for Latent Semantic Analysis" (PDF). Interspeech'2005.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
 ↑ Matthew Brand (2006). "Fast LowRank Modifications of the Thin Singular Value Decomposition" (PDF). Linear Algebra and Its Applications. 415: 20–30. doi:10.1016/j.laa.2005.07.021.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
 ↑ doi: 10.1109/ICCSNT.2011.6182070
 ↑ J Transl Med. 2014 Nov 27;12(1):324.
 ↑ Thomas Hofmann (1999). "Probabilistic Latent Semantic Analysis" (PDF). Uncertainty in Artificial Intelligence.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
 Thomas Landauer, Peter W. Foltz, & Darrell Laham (1998). "Introduction to Latent Semantic Analysis" (PDF). Discourse Processes. 25 (2–3): 259–284. doi:10.1080/01638539809545028.CS1 maint: multiple names: authors list (link)<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
 Scott Deerwester, Susan T. Dumais, George W. Furnas, Thomas K. Landauer, Richard Harshman (1990). "Indexing by Latent Semantic Analysis" (PDF). Journal of the American Society for Information Science. 41 (6): 391–407. doi:10.1002/(SICI)10974571(199009)41:6<391::AIDASI1>3.0.CO;29.CS1 maint: multiple names: authors list (link)<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles> Original article where the model was first exposed.
 Michael Berry, Susan T. Dumais, Gavin W. O'Brien (1995). "Using Linear Algebra for Intelligent Information Retrieval". Cite journal requires
journal=
(help)CS1 maint: multiple names: authors list (link)<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles> (PDF). Illustration of the application of LSA to document retrieval.  "Latent Semantic Analysis". InfoVis.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
 Fridolin Wild (November 23, 2005). "An Open Source LSA Package for R". CRAN. Retrieved 20061120.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
 Thomas Landauer, Susan T. Dumais. "A Solution to Plato's Problem: The Latent Semantic Analysis Theory of Acquisition, Induction, and Representation of Knowledge". Retrieved 20070702.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
External links
Articles on LSA
 Latent Semantic Analysis, a scholarpedia article on LSA written by Tom Landauer, one of the creators of LSA.
Talks and demonstrations
 LSA Overview, talk by Prof. Thomas Hofmann describing LSA, its applications in Information Retrieval, and its connections to probabilistic latent semantic analysis.
 Complete LSA sample code in C# for Windows. The demo code includes enumeration of text files, filtering stop words, stemming, making a documentterm matrix and SVD.
Implementations
Due to its crossdomain applications in Information Retrieval, Natural Language Processing (NLP), Cognitive Science and Computational Linguistics, LSA has been implemented to support many different kinds of applications.
 Sense Clusters, an Information Retrievaloriented perl implementation of LSA
 SSpace Package, a Computational Linguistics and Cognitive Scienceoriented Java implementation of LSA
 Semantic Vectors applies Random Projection, LSA, and Reflective Random Indexing to Lucene termdocument matrices
 Infomap Project, an NLPoriented C implementation of LSA (superseded by semanticvectors project)
 Text to Matrix Generator, A MATLAB Toolbox for generating termdocument matrices from text collections, with support for LSA
 Gensim contains a Python implementation of LSA for matrices larger than RAM.
 Wikipedia articles needing page number citations from January 2012
 CS1 maint: multiple names: authors list
 Articles with inconsistent citation formats
 CS1 errors: missing periodical
 Articles to be merged from July 2012
 Articles with unsourced statements from October 2013
 Information retrieval techniques
 Natural language processing
 Latent variable models