Find answers from the community

Updated 2 years ago

Hi

Hi!
I have 5 pages QA text file. I have working discord bot. But answers are not accurate or even mixed from different Q-A pairs. How I can do it correctly? Is there a way to tune it or maybe I missing something.
L
z
5 comments
Make each QA it's own "Document" object is my initial guess at an improvement
Plain Text
qa_pair = """
Question: Blah
Answer: Blah
"""
document = Document(qa_pair)

Or split the qa_pairs into their own text files and use the SimpleDirectoryReader πŸ™‚
Oh thanks! I will try that
Ah, and you may want to also increase the top k when you do this (since every q/a pair will become a node now)

index.as_query_engine(similarity_top_k=5) will set the top k to 5
Thanks a lot! Now it's almost perfect! Appreciate!
Add a reply
Sign up and join the conversation on Discord