Find answers from the community

Updated 2 months ago

How does vector similarity work I have a

How does vector similarity work? I have a case in which I have a group of documents, and I have sent an exact sentence found in one of the documents, but when I checked the returned nodes, none of them contains the sentence I have sent; any clarification why this may happen?
L
1 comment
The embeddings generated from a single sentence will be different than the embeddings generated for an entire chunk/node. The node has more context, which biases the embeddings, compared to a single sentence

Hence, typing exact sentences is not a good way to test vector similarity. It's more about the similarities in overall semantics.

You can augment vector search by also using a keyword index. There is an example here that sets up a custom retriever to do just that
https://github.com/jerryjliu/llama_index/blob/main/docs/examples/query_engine/CustomRetrievers.ipynb
Add a reply
Sign up and join the conversation on Discord