Find answers from the community

Updated 2 years ago

lets say I have a vector store index of

lets say I have a vector_store_index of keywords like (goat, sheep, cow, iron, zinc, copper, iron sheets etc), how do I use Llama index to return the main keywords related to say a new word like 'donkey' and their similarity score using cosine?
L
1 comment
When you query an index, the similarity score is returned in the response object

response.source_nodes[0].score will give the score of the first source node

Just keep in mind the default top k is 2, but you can change that

index.as_query_engine(similarity_top_k=2)
Add a reply
Sign up and join the conversation on Discord