Content deleted Content added
Tags: Mobile edit Mobile web edit |
use standard variant |
||
(20 intermediate revisions by 14 users not shown) | |||
Line 1:
{{Short description|Model for representing text documents}}
'''Vector space model''' or '''term vector model''' is an algebraic model for representing text documents (
| last1 = Berry | first1 = Michael W.
| last2 = Drmac | first2 = Zlatko
| last3 = Jessup | first3 = Elizabeth R.
| date = January 1999
| doi = 10.1137/s0036144598347035
| issue = 2
| journal = SIAM Review
| pages = 335–362
| title = Matrices, Vector Spaces, and Information Retrieval
| volume = 41}}</ref>
==Definitions==
In this section we consider a particular vector space model based on the [[Bag-of-words model|bag-of-words]] representation. Documents and queries are represented as vectors.
:<math>d_j = ( w_{1,j} ,w_{2,j} , \dotsc ,w_{n,j} )</math>
Line 12 ⟶ 22:
The definition of ''term'' depends on the application. Typically terms are single words, [[keyword (linguistics)|keyword]]s, or longer phrases. If words are chosen to be the terms, the dimensionality of the vector is the number of words in the vocabulary (the number of distinct words occurring in the [[text corpus|corpus]]).
Vector operations can be used to compare documents with queries.<ref name=":0">{{Cite book |last=Büttcher |first=Stefan |title=Information retrieval: implementing and evaluating search engines |last2=Clarke |first2=Charles L. A. |last3=Cormack |first3=Gordon V. |date=2016 |publisher=The MIT Press |isbn=978-0-262-52887-0 |edition=First MIT Press paperback |___location=Cambridge, Massachusetts London, England}}</ref>
==Applications==
[[File:vector space model.jpg|right|250px]]
Candidate documents from the corpus can be retrieved and ranked using a variety of methods. [[Relevance (information retrieval)|Relevance]] [[ranking]]s of documents in a keyword search can be calculated, using the assumptions of [[semantic similarity|document similarities]] theory, by comparing the deviation of angles between each document vector and the original query vector where the query is represented as a vector with same dimension as the vectors that represent the other documents.
In practice, it is easier to calculate the [[cosine]] of the angle between the vectors, instead of the angle itself:
Line 35 ⟶ 45:
:<math>\mathrm{cos}(d_j,q) = \frac{\mathbf{d_j} \cdot \mathbf{q}}{\left\| \mathbf{d_j} \right\| \left \| \mathbf{q} \right\|} = \frac{\sum _{i=1}^N d_{i,j}q_{i}}{\sqrt{\sum _{i=1}^N d_{i,j}^2}\sqrt{\sum _{i=1}^N q_{i}^2}}</math>
As all vectors under consideration by this model are element-wise nonnegative, a cosine value of zero means that the query and document vector are [[orthogonal]] and have no match (i.e. the query term does not exist in the document being considered). See [[cosine similarity]] for further information.<ref name=":0" />
== Term
In the classic vector space model proposed by [[Gerard Salton|Salton]], Wong and Yang
:<math>
Line 51 ⟶ 61:
The vector space model has the following advantages over the [[Standard Boolean model]]:
#Allows ranking documents according to their possible relevance
#Allows retrieving items with a partial
Most of these advantages are a consequence of the difference in the density of the document collection representation between Boolean and term frequency-inverse document frequency approaches. When using Boolean weights, any document lies in a vertex in a n-dimensional [[hypercube]]. Therefore, the possible document representations are <math>2^n</math> and the maximum Euclidean distance between pairs is <math>\sqrt{n}</math>. As documents are added to the document collection, the region defined by the hypercube's vertices become more populated and hence denser. Unlike Boolean, when a document is added using term frequency-inverse document frequency weights, the inverse document frequencies of the terms in the new document decrease while that of the remaining terms increase. In average, as documents are added, the region where documents lie expands regulating the density of the entire collection representation. This behavior models the original motivation of Salton and his colleagues that a document collection represented in a low density region could yield better retrieval results.
Line 61 ⟶ 68:
The vector space model has the following limitations:
#Query terms are assumed to be independent, so phrases might not be represented well in the ranking
#Semantic sensitivity; documents with similar context but different term vocabulary won't be associated
▲#Semantic sensitivity; documents with similar context but different term vocabulary won't be associated, resulting in a "[[false negative]] match".
Many of these difficulties can, however, be overcome by the integration of various tools, including mathematical techniques such as [[singular value decomposition]] and [[lexical database]]s such as [[WordNet]].
Line 80 ⟶ 83:
==Software that implements the vector space model==
{{further information|Vector database}}
The following software packages may be of interest to those wishing to experiment with vector models and implement search services based upon them.
===Free open source software===
* [[Apache Lucene]]. Apache Lucene is a high-performance, open source, full-featured text search engine library written entirely in Java.
* [[OpenSearch (software)]], [[Elasticsearch]] and [[Apache Solr|Solr]]
* [[Gensim]] is a Python+[[NumPy]] framework for Vector Space modelling. It contains incremental (memory-efficient) algorithms for [[tf–idf|term frequency-inverse document frequency]], [[Latent Semantic Indexing|latent semantic indexing]], [[
* [[Weka (machine learning)|Weka]]. Weka is a popular data mining package for Java including WordVectors and [[Bag-of-words model|Bag Of Words models]].
* [[Word2vec]]. Word2vec uses vector spaces for word embeddings.
Line 92 ⟶ 96:
* [[Gerard Salton|G. Salton]] (1962), "[https://dl.acm.org/citation.cfm?id=1461544 Some experiments in the generation of word and document associations]" ''Proceeding AFIPS '62 (Fall) Proceedings of the December 4–6, 1962, fall joint computer conference'', pages 234–250. ''(Early paper of Salton using the term-document matrix formalization)''
* [[Gerard Salton|G. Salton]], A. Wong, and C. S. Yang (1975), "[https://dl.acm.org/citation.cfm?id=361220 A Vector Space Model for Automatic Indexing]" ''Communications of the ACM'', vol. 18, nr. 11, pages 613–620. ''(Article in which a vector space model was presented)''
* David Dubin (2004), [
* [https://web.archive.org/web/20110814000253/http://cogsys.imm.dtu.dk/thor/projects/multimedia/textmining/node5.html Description of the vector space model]
* [http://www.miislita.com/term-vector/term-vector-3.html Description of the classic vector space model by Dr E. Garcia]
|