How to get Retrieval QA to return the exact document that contains the answer from the retrieved top k document?

119 Views Asked by At

I'm creating a QA bot with RAG and aiming to provide the specific documents from which the answers are extracted. Retrieval QA uses k documents which are semantically similar to query to generate the answer. The answer need not be in all the k documents, how can we know which documents out of the k documents the answer is extracted from?

How can we know which of those source documents that LLM extracted the answer from?

0

There are 0 best solutions below