Find answers from the community

Updated 3 months ago

Hi

Hi,
Does anyone know how we can add citations to responses like you.com or perplexity.ai ?
j
A
5 comments
you can parse response.source_nodes to get the source text chunks + document id's
@jerryjliu0 thanks for your response! I agree that we can use response.source_nodes. But you.com and perpexity.ai add inline citations. How to determine which line is coming from which source document. Should I do text/keyword matching to determine this? We might have false attributions by this approach..
Ahhh I see what you're saying. Don't think we have this feature yet, but can look into adding!
@jerryjliu0 paper-qa based on langchain asks the LLM in the prompt itself to specify the citation. See this prompt: https://github.com/whitead/paper-qa/blob/7173e053767d9102b6685bb6b65eafcf5ebf4a7f/paperqa/qaprompts.py#L19. It has "...For each sentence in your answer, indicate which sources most support it ..".
How trustworthy do you expect such attributions to be? Can you think of any alternative approaches?
Add a reply
Sign up and join the conversation on Discord