Find answers from the community

Updated 3 months ago

Hi, "How can I build this with

Hi, "How can I build this with llamaindex", suppose I have 1000 questions-answer set in a pdf file on a topic by different expert , i want to build an application where , people will ask question and if there is one or more answer to his/her question , he/she will get the answer from the document with reference (reference means , he/she will get the answer and also the name of the expert who gave the answer)
W
L
3 comments
you can add this kind of info in the metadata of the document.

document = Document(text="set of QnA pair" metadata={"author":"Sabu"})

Now when you will query, Returned resposne will contain source nodes it used to answer along with the metadata.

You can check the source nodes and send the author name forward
Thank you so much
I am following this tutorial : https://www.youtube.com/watch?v=mIyZ_9gqakE&t=340s

I have a list of documents : documents are article of different writer , in my document metadata i put the name of the writer of article
I used HierarchicalNodeParser
This code below gives me the retrieved node for the query ,
from llama_index.core import QueryBundle
hierarchical_nodes = hierarchical_engine.retrieve(QueryBundle("How do I setup a query engine?"))
print("\n--- Hierarchical ---\n")
print('\n---\n'.join([node.node.text for node in hierarchical_nodes]))

Now what I want is , I what to make an query engine where the query to the LLM will be like this ,

This is the questions “How do I setup a query engine?”

This is the retrieved contest “node.node.text”
Answer the query based on the context and in the end writer that this answer is from the idea of the writer
node.metadat.author(I do not know how to find the name of the author from the metadata )

This is the document format

markdown_docs.append(
Document(
text=current_text.strip(),
metadata={
"File Name": filename,
"Content Type": "text",
"Author Name":"Andrew Grove",
"Header Path": "/".join(header_stack),
"Links": ", ".join(links),
},
)
)



How can I make such query engine ?
Add a reply
Sign up and join the conversation on Discord