Find answers from the community

Updated 2 months ago

Why does index always work on the last

Why does index always work on the last index?
W
k
6 comments
Can you elaborate on your query?
Random example, real data blurred: when I searched for the author of Wonders of the Unknown, the first thing indexed was (Exploring the Unknown: Book Title. Author Beebe, published in English in 1923 under the title "Wonders of the Unknown"). The content of the tenth index is (Frontiers of Knowledge: The Scientific Exploration Program is a joint project of international research institutions. (The goal of the program is to push the boundaries of science and unravel the mysteries of the natural world). The content of the tenth index is irrelevant to the question, but the final data generated falsely claims that the authors are international research organizations.
query_engine = index.as_query_engine(similarity_top_k=10)
Okay so while answering it is pulling irrelevant source nodes ?

You can give try to Similarity Postprocessor to set a threshold value which will limit the fetching of nodes based on the set threshold

Plain Text
from llama_index.postprocessor import SimilarityPostprocessor

query_engine = index.as_query_engine(similarity_top_k=10,node_postprocessors=[                        SimilarityPostprocessor(similarity_cutoff=0.7)])
Thank you, while this question is still not resolved, other questions were answered well.
Add a reply
Sign up and join the conversation on Discord