Find answers from the community

Updated last month

Retrieving Relevant Metadata and Sentence-Level Context for Responses

I am using VectorStoreIndex. When I generate a response, I want to see if I can get where in a node that the answer is generated from. It's not enough to check the source_node score - I want to get which sentences or paragraphs from the context where an answer is pulled from.
I believe I can get this by customizing the prompt and insert extra metadata information associated with each node. Then I want to add an additional instruction in the prompt "pull the relevant metadata and which sentences where the answer was generated from".
I'm not quite sure if I can do this at a high level, or if I need to build a response synthesis from scratch. Any help on this?
L
h
5 comments
Use fuzzy matching instead against the source node text
Nice library for this, split your source nodes and responses into sentences (or some other delimeter) and compute some matrix to find the closest
@Logan M
I am finding that my first pass using above technique using levenshtein distance is yielding mediocre results.
***
w kapa.ai/phorm.ai, getting the reference url is fairly basic, but when I do search results, google is able to provide the precise paragraph that best fits an answer. Still not sure how to do that easily.
I imagine I can get all the embeddings of each sentence and find the cosine distance that best matches the provided answer
Yea thats another approach for sure. Even BM25 per-sentence is probably good too if it needs to be faster
Add a reply
Sign up and join the conversation on Discord