20260202

Using a vector index

 For example, imagine you have two documents with the following contents:


"The children played joyfully in the park."

"Kids happily ran around the playground."


These two documents contain texts that are semantically related, even though different words are used. By creating vector embeddings for the text in the documents, the relation between the words in the text can be mathematically calculated.


Imagine the keywords being extracted from the document and plotted as a vector in a multidimensional space:






The distance between vectors can be calculated by measuring the cosine of the angle between two vectors, also known as the cosine similarity. In other words, the cosine similarity computes the semantic similarity between documents and a query.

By representing words and their meanings with vectors, you can extract relevant context from your data source even when your data is stored in different formats (text or image) and languages.



Related Posts Plugin for WordPress, Blogger...