Spatial vector Model Lucene

Source: Internet
Author: User

Consider a document as a collection of a series of lexical elements, each of which has a weight, as follows:

Document a= {termx, Termy, Termz ... termn}

Document b= {termx, Termy, Termz ... termn}

Documentvector = {weight1, weight2, weight3 ... weightn}

Weigh the length of the mapping of each participle to the unit matrix. This puts the document into an n-dimensional space vector (matrix) "All documents are divided into n-dimensional vector matrices, and in which document D is mapped on M-coordinates as the weight of M-words in document D" Gets the vector coordinate system, and the retrieval of document information is converted to the angle size between two vectors.

cosine similarity determines the similarity between two vectors by measuring the cosine of the angle of the inner product space of two vectors. The closer the cosine value is to 1, the closer the angle is to 0, the more similar the two vectors are.

the cosine of the two vectors can be deduced according to Euclidean dot product and magnitude formula:
(9)
by the formula (9) as well as the theory, we can draw:
(Ten)
The correlation between the query string and the records in the index can be obtained by calculating the cosine of the angle between the query vector and each vector..
The query word is appended with ^n to set the weight of this query word, the default is 1, if n is greater than 1, then this query word is more important, if n is less than 1, then this query word is less important. ^ n represents the length of each word in the matrix. (using a matrix to represent coordinates, for personal expansion of the idea, to a portal http://blog.csdn.net/myan/article/details/1865397)

Spatial vector Model Lucene

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.