Source-linked AI summary
From Frequency to Meaning: Vector Space Models of Semantics
Peter D. Turney, Patrick Pantel
TL;DR
Computers have limited understanding of human-language meaning, while no comprehensive, up-to-date survey covers the rapidly growing field of semantic vector space models. This paper organizes applications by three matrix structures and concludes that VSMs are a successful approach with broad actual and potential applications.
Problem
The field lacked a comprehensive, up-to-date survey of rapidly growing vector space models for semantic processing of human language.
Method
The survey organizes VSM research by term-document, word-context, and pair-pattern matrix structures, covering applications and one open-source project in each category.
Results
The survey finds VSMs to be a highly successful semantic approach with a wide range of actual and potential applications.
Takeaways & Limitations
Matrix structure is the most important factor determining which VSM applications are possible, while linguistic and mathematical processing play smaller but important roles.
Takeaways & Limitations
Highly accurate tokenization remains challenging across human languages, with segmentation ambiguity and disagreement among native speakers.
Abstract
from arXiv · showhide
Computers understand very little of the meaning of human language. This profoundly limits our ability to give instructions to computers, the ability of computers to explain their actions to us, and the ability of computers to analyse and process text. Vector space models (VSMs) of semantics are beginning to address these limits. This paper surveys the use of VSMs for semantic processing of text. We organize the literature on VSMs according to the structure of the matrix in a VSM. There are currently three broad classes of VSMs, based on term-document, word-context, and pair-pattern matrices, yielding three classes of applications. We survey a broad range of applications in these three categories and we take a detailed look at a specific open source project in each category. Our goal in this survey is to show the breadth of applications of VSMs for semantics, to provide a new perspective on VSMs for those who are already familiar with the area, and to provide pointers into the literature for those who are less familiar with the field.
1. Introduction
The paper surveys vector space models as a successful, frequency-based approach to representing aspects of language meaning, organizing their applications by term–document, word–context, and pair–pattern matrices.
- Motivation: VSMs address computers’ limited understanding of human-language meaning by extracting semantic information from corpus frequencies.Their defining values derive from event frequencies, such as word occurrences in contexts.
- Applications: 92.5% was achieved on TOEFL multiple-choice synonym questions using a vector-based representation of word meaning, compared with a 64.5% average human score.The result illustrates the strong performance of VSMs on semantic tasks.
- Framework: The survey organizes VSM research by term–document, word–context, and pair–pattern matrices, treating matrix structure as fundamental to potential applications.The framework may motivate new row, column, or higher-order tensor structures.
- Applications: VSMs perform well across semantic similarity tasks involving words, phrases, documents, and semantic relations.They underpin most search engines’ query–document similarity measures and leading relatedness algorithms.
- Contributions: The paper provides an up-to-date, unified survey framework for a rapidly growing field with broad actual and potential applications.Its goals include introducing VSMs to newcomers and offering a new perspective to researchers already familiar with the area.
- Contributions: The survey emphasizes pair–pattern matrices as a relatively new approach that can address word-order limitations associated with word–context matrices.It also presents the breadth of practical applications in natural language processing and computational linguistics.
2. Vector Space Models of Semantics
Vector space models use statistical patterns of human word usage to infer meaning. This section introduces term–document, word–context, and pair–pattern matrices as representations for documents, words, and relations.
- Statistical semantics: The statistical semantics hypothesis holds that patterns of human word usage can be used to determine what people mean.It underlies the bag of words, distributional, extended distributional, and latent relation hypotheses.
- Term–document matrices: A term–document matrix represents terms as rows and documents as columns, with each document vector encoding a bag of words.The bag of words hypothesis uses word frequencies to estimate document relevance to a query.
- Term–document matrices: Term and document vectors act as signatures whose numerical patterns indicate, to some degree, what the corresponding term or document is about.Although document vectors discard word order and phrase structure, search engines still work surprisingly well because vectors capture an important aspect of semantics.
- Word–context matrices: The distributional hypothesis states that words occurring in similar contexts tend to have similar meanings, motivating word–context matrices for word similarity.Contexts may include word windows, grammatical dependencies, and larger textual units.
- Pair–pattern matrices: Pair–pattern matrices represent word pairs through their co-occurring patterns to measure similarity between semantic relations.Examples include mason:stone, carpenter:wood, potter:clay, and glassblower:glass, which share the relation artisan:material.
- Pair–pattern matrices: Relational similarity cannot generally be reduced to the sum of attributional similarities between the two constituent word pairs.Mason, carpenter, potter, and glassblower are similar words, as are wood, clay, stone, and glass, yet their relations require separate treatment.
3. Linguistic Processing for Vector Space Models
Linguistic processing prepares raw text for vector space matrices through tokenization, normalization, and annotation. These choices address linguistic variation and ambiguity, but trade recall against precision and remain difficult across languages.
- Overview: Processing raw text for term–document, word–context, or pair–pattern matrices involves tokenization, optional normalization, and annotation.Tokenization determines terms; normalization converts superficial variants to common forms; annotation marks context-dependent meanings.
- Tokenization: Accurate tokenization must handle punctuation, hyphenation, multi-word terms, and optional stop-word removal.Examples include don’t, state-of-the-art, Barack Obama, and ice hockey; stop words are frequent, relatively low-information words.
- Tokenization: Highly accurate tokenization is challenging across languages because words may lack spaces, lexicon matching may be ambiguous, and speakers may disagree about segmentation.Chinese can be tokenized into character unigrams or bigrams, but more sophisticated lexicon-based matching may not yield a unique result.
- Normalization: Normalization reduces superficial variation through case folding and stemming, but can erase semantically significant distinctions.Case folding can conflate accented French words or meaningful English capitalization, while stemming reduces inflected words to stems.
- Normalization and annotation: Normalization generally increases recall and reduces precision, whereas annotation generally decreases recall and increases precision.Normalization broadens similarity matching, while part-of-speech, word-sense, and syntactic annotation can selectively distinguish meanings such as program as a noun versus a verb.
4. Mathematical Processing for Vector Space Models
Mathematical processing for vector space models involves constructing a frequency matrix, transforming its weights, smoothing the space, and calculating similarities. For word–context models, this same four-step process is used to reduce noise and sparsity before measuring similarity.
- Processing pipeline: Weight transformation reduces the influence of common words, which are frequent but less informative than rare words.The transformation adjusts the weights of matrix elements after raw frequencies are generated.
- Processing pipeline: Smoothing reduces random noise and can fill zero elements in sparse matrices before similarities are measured.For word–context VSMs, smoothing is also described as dimensionality reduction.
- Processing pipeline: VSM construction proceeds through four steps: calculating frequencies, transforming raw counts, smoothing the space, and calculating similarities.Smoothing can reduce random noise and dimensionality while filling some zero elements in sparse matrices.
4.1 Building the Frequency Matrix
Building a frequency matrix amounts to counting how often items occur in specified situations, but large corpora make this process practically complex. A typical implementation scans the corpus, records events and frequencies, then generates a sparse matrix.
- Building the Frequency Matrix: Each matrix element records how many times an item occurred in a particular situation.Items may be terms, words, or word pairs; situations may be documents, contexts, or patterns.
- Building the Frequency Matrix: Large corpora complicate the otherwise simple task of counting events.
- Building the Frequency Matrix: A typical workflow scans the corpus sequentially, stores events and frequencies in a data structure, and generates the matrix using a sparse representation.The intermediate structure may be a hash table, database, or search engine index.
4.2 Weighting the Elements
Weighting emphasizes surprising, discriminative events while reducing the influence of expected, correlated, or uninformative terms. The section also presents PMI and PPMI, including PMI’s bias toward infrequent events and proposed smoothing remedies.
- Weighting the Elements: Weighting assigns greater importance to surprising events because shared surprising contexts are hypothesized to discriminate vector similarity better than expected contexts.For mouse and rat, dissect and exterminate are more discriminative contexts than have and like.
- Weighting the Elements: Length normalization corrects information-retrieval bias toward longer documents when document length is otherwise ignored.It is often combined with tf-idf weighting.
- Weighting the Elements: Term weighting can reduce the influence of correlated terms, while feature selection gives selected terms weight zero and removes them from the matrix.Hostage and hostages may be downweighted when they co-occur because their meanings differ slightly.
- Weighting the Elements: PMI and PPMI provide alternatives to tf-idf; PPMI replaces negative PMI values with zero and performs well across several weighting approaches for semantic similarity.PPMI gives high values to informative word–context relations and zero to uninformative occurrences.
- Weighting the Elements: PMI is biased toward infrequent events, so discounting factors and Laplace smoothing have been proposed to reduce this effect by pushing PMI values toward zero.Laplace smoothing adds a positive constant k to raw frequencies before probability estimation; larger k produces stronger smoothing.
4.3 Smoothing the Matrix
This section presents matrix smoothing as a way to improve semantic similarity and information retrieval, focusing on truncated SVD and four compatible interpretations of its effects.
- Truncated SVD: Truncated SVD approximates a term–document or word–context matrix with a lower-rank representation that improves similarity measurement.It retains the top k singular values and produces the rank-k matrix that best approximates the original under Frobenius-norm error.
- Latent meaning: Limiting the latent dimensions forces stronger correspondence between words and contexts, thereby capturing latent meaning and improving similarity measurement.The truncated representation creates a low-dimensional linear mapping between row space and column space.
- Noise reduction: Truncated SVD can reduce noise by retaining variation attributed mainly to signal while discarding components that primarily fit noise.The reduced representation is described as a smoothed version of the original matrix.
- High-order co-occurrence: Truncated SVD discovers high-order co-occurrence by relating words that appear in similar rather than identical contexts.Similarity of contexts can be defined recursively in terms of lower-order co-occurrence.
- Sparsity reduction: Because the original matrix is sparse whereas the truncated representation is dense, truncated SVD can simulate missing text and compensate for insufficient data.This perspective treats sparsity as a consequence of insufficient textual evidence.
- Alternative smoothing algorithms: Later smoothing algorithms share these four interpretations but are generally more computationally intensive and attempt to model word frequencies better than SVD.Examples include NMF, PLSI, IS, KPCA, LDA, and DCA.
4.4 Comparing the Vectors
Vector similarity is most commonly measured with cosine, which compares normalized vector direction rather than magnitude. Comparisons across tasks show cosine often performs best, while alternative measures differ in their sensitivity to word frequency.
- Cosine similarity: Cosine similarity is the most popular measure for comparing frequency vectors and captures directional similarity after normalization.It treats vector length as irrelevant, allowing frequent and rare words to be similar when their contextual directions align.
- Cosine similarity: Cosine ranges from −1 for opposite directions to +1 for identical directions, with zero for orthogonal vectors.Raw frequency vectors cannot produce negative cosine values, but weighting and smoothing can introduce negative elements.
- Empirical comparisons: Across four word-similarity tasks, cosine was the best overall measure among five distance measures and cosine similarity.The compared distances were Euclidean, Manhattan, Hellinger, Bhattacharya, and Kullback-Leibler.
- Frequency sensitivity: Similarity measures differ in frequency sensitivity: cosine and related methods favor high-frequency words, precision favors low-frequency words, and Jaccard-like methods favor similar frequencies.For a target word w0, high-frequency-sensitive measures tend to score higher-frequency words wi more highly, whereas low-frequency-sensitive measures bias toward lower-frequency words.
4.5 Efficient Comparisons
Efficient similarity computation relies on exploiting sparse shared coordinates, weighting schemes, and parallel or approximate methods to reduce the cost of comparing large matrices. Randomized projections offer substantial efficiency gains with little average error, while performance varies by corpus and method.
- Sparse computation: Sparse-matrix multiplication computes similarity contributions only for coordinates shared by vectors, exploiting the sparsity of most vectors.Cosine, overlap, and Dice can be decomposed into components based on shared and individual nonzero values.
- Sparse computation: The sparse algorithm has worst-case complexity O(ncv) and is efficient only when coordinate density is low.Here, n is the number of vectors, c the maximum number of nonzero coordinates per vector, and v the number sharing the most frequent nonzero coordinate.
- Weighting-based optimization: Setting low-PPMI, PMI, or tf-idf coordinates to zero dramatically reduces density while sacrificing little discriminative power.Another strategy omits coordinates with the highest number of nonzero values, although its advantage is conditional.
- Parallel computation: MapReduce distributes similarity computation across parallel Map tasks and groups outputs by matrix rows or columns during Reduce.The implementation addresses matrices that cannot fit into memory, with m and n controlling inverted-index memory and parallelism tradeoffs.
- Approximate computation: Randomized projection methods reduce memory and time costs with little average error, especially when only the top-k similar vectors are needed.Random Indexing has complexity O(nrncδ1), while δ1 controls the accuracy-efficiency tradeoff; LSH similarly uses random projections to create short signatures.
- Approximate computation: On the BNC corpus, LSH outperformed Random Indexing, whereas Random Indexing outperformed LSH in both efficiency and accuracy on a larger combined corpus.The larger corpus combined BNC, the Reuters Corpus, and most English news holdings of the LDC in 2003, using δ2 = 10,000 random projections for LSH.
4.6 Machine Learning
Vector space model vectors can be used with any machine-learning algorithm that operates on real-valued vectors, supporting unsupervised, supervised, and semi-supervised learning. The choice of algorithm is determined by performance on the task rather than by anything unique to VSMs.
- Machine Learning: Any algorithm that works with real-valued vectors can use VSM vectors, although linguistic and mathematical processing may still be necessary.The algorithm can handle vector comparison after these processing steps.
- Machine Learning: VSM vectors support unsupervised clustering, supervised classification, and semi-supervised learning.Cosine similarity can support nearest-neighbour classification and similarity-based clustering.
- Machine Learning: No machine-learning algorithm is uniquely compelled by VSMs; selection should depend on performance for the given task.The survey therefore defers algorithmic guidance to the broader machine-learning literature.
5. Three Open Source VSM Systems
The section presents three portable, easy-to-use Java open-source systems, one for each VSM type. It describes Lucene for term–document matrices, Semantic Vectors for word similarity, and LRA for pair–pattern matrices.
- Overview: Three open-source Java systems illustrate term–document, word–context, and pair–pattern VSMs, with portability and ease of use as design goals.The systems are presented so readers can inspect their source code and apply them in their own projects.
- Lucene: Lucene is a full-featured term–document search library providing storage, indexing, retrieval, ranking, and multiple query types.It stores content fields and statistics such as frequency and tf-idf, while supporting phrase, wildcard, proximity, range, and field-restricted queries.
- Semantic Vectors: Semantic Vectors uses Lucene’s term–document matrix and random projection to create vectors for measuring word and document similarity.Its modular package can generate word or document vectors and search for similar words or documents.
- Semantic Vectors: Random projection maps high-dimensional vectors into relatively low-dimensional spaces, emphasizing simplicity and efficiency over potentially stronger smoothing.The developers argue that other smoothing algorithms may smooth better, but none perform as well as random indexing.
- Latent Relational Analysis: LRA builds a pair–pattern matrix from corpus patterns linking input word pairs, counts pattern frequencies, and smooths them using SVD.It uses thesaurus expansion to mitigate sparse pair occurrences and Lucene to store, index, and serve the matrix.
6. Applications
Section 6 surveys the scope and flexibility of VSM semantic applications, grouping them by term–document, word–context, and pair–pattern matrices. These applications measure document, word, or relational similarity and support retrieval, classification, clustering, and related tasks.
- Term–document matrices: Term–document matrices measure document and query similarity, typically using cosine similarity, supporting retrieval, clustering, classification, segmentation, question answering, and call routing.Document retrieval ranks documents by decreasing cosine similarity to the query vector.
- Term–document matrices: Document clustering groups documents for high within-group and low across-group similarity, using flat or hierarchical and hard or soft cluster structures.Clustering methods also differ in how they compare and abstract clusters.
- Word–context matrices: Word–context matrices measure word similarity and support word clustering, word classification, automatic thesaurus generation, and word sense disambiguation.Word classification has been applied to positive and negative words using the General Inquirer lexicon, which contains 11,788 words and 182 categories.
- Word–context matrices: 64.4% correct for the word–context matrix on 80 TOEFL synonym questions, compared with 64.5% for the average non-English US college applicant.The result was reported as human-level performance for the word-similarity approach.
- Pair–pattern matrices: Pair–pattern matrices measure relational similarity and classify semantic relations in word pairs, including analogies, verb pairs, and noun compounds.Examples include taint : poison classified as strength and assess : review classified as enablement.
7. Alternative Approaches to Semantics
The section surveys alternatives to VSMs for semantic similarity of documents, words, and relations, including probabilistic models and lexicon-based approaches. It also notes growing overlap between VSMs and probabilistic models, and suggests combining distributional and lexical information can improve word-similarity performance.
- Term–document matrices: Probabilistic models measure document–query similarity by estimating a document language model and computing the query’s probability under it.Traditional probabilistic retrieval models and statistical language models are presented as alternatives for term–document applications.
- Term–document matrices: The distinction between VSMs and probabilistic approaches is becoming blurred as each borrows ideas from the other.Adding logarithms of probabilities can make language models resemble VSMs.
- Word–context matrices: Lexicon-based approaches such as WordNet measure word similarity by representing word senses as graph nodes connected by semantic relations.Relations include hypernymy and hyponymy.
- Word–context matrices: Hybrid methods combine VSMs with lexicons because human semantic judgments draw on both dictionary definitions and observed word usage.The section therefore expects algorithms using both distributional and lexical information to achieve the best performance.
- Pair–pattern matrices: Lexicon-based approaches to relational similarity reduce simr(a : b, c : d) to attributional similarities between corresponding entities.The stated approximation is simr(a : b, c : d) ≈ sima(a, c) + sima(b, d).
8. The Future of Vector Space Models of Semantics
The future of vector space models depends on addressing their treatment of word order and determining whether distributional patterns of word usage suffice to represent meaning. Although current models cannot represent arbitrary first-order predicate-calculus statements, several approaches show that word order and compositional meaning can be modeled, leaving open the scope of their semantic coverage.
- Word order and composition: Term–document and word–context matrices typically ignore word order, causing phrases such as house boat and boat house to receive the same representation despite different meanings.In LSA, phrases are commonly represented by summing the vectors of their individual words.
- Word order and composition: Several approaches address word order, including syntax-aware composition, Hilbert-space tensor products, quantum-inspired operators, and pair–pattern matrices.Pair–pattern matrices are sensitive to the order of words in a pair.
- Limits of semantic representation: Vectors can represent disjunction, conjunction, and negation, but arbitrary statements in first-order predicate calculus remain unrepresented.Future work may discover ways to overcome these limitations.
- Limits of semantic representation: The survey’s frequency-derived VSMs depend on distributional hypotheses, making the sufficiency of statistical word-use patterns for recovering meaning a major open question.Its answer will determine the future of VSMs.
9. Conclusions
The conclusion frames natural-language understanding as essential to realizing computers’ full potential and connects word meaning to usage statistics represented in vector space models. It presents matrix structure as the key organizing factor in VSM applications while emphasizing the survey’s breadth and potential for further research.
- Motivation: Natural-language understanding is necessary for computers to communicate with people and reach their full potential.Without it, users must rely on artificial languages and unnatural interfaces.
- VSM foundation: Word meaning is closely connected to word-usage statistics, which can be represented as vectors of values derived from event frequencies.This connection motivates the use of vector space models for semantics.
- Survey framework: The survey organizes VSM research by three matrix structures: term–document, word–context, and pair–pattern.The authors argue that matrix structure most strongly determines possible applications, while linguistic and mathematical processing play smaller but important roles.
- Research outlook: The survey aims to demonstrate VSMs’ breadth and power, support newcomers, and offer a new perspective to experienced researchers.Its emphasis on matrix structure is intended to inspire research into additional matrix types and tensors that could enable more applications.