Find answers from the community

Updated last year

Limit

At a glance
Hello!

For VectorStoreIndex, there is an argument similarity_top_k to limit the number of queries, but is there any way to limit the number of queries for KeywordTableIndex?

I know there is max_keywords_per_chunk, but this does not limit the number of queries, does it?

Thankyou
L
2 comments
There is no limit, because how do you decide which to use and which not to use?

Since there is no distance metric, there is no easy answer

You could write a quick custom node_postprocessor to arbitrarily limit the retrieved nodes

Or maybe re-ranking is a better option
https://docs.llamaindex.ai/en/stable/core_modules/query_modules/node_postprocessors/modules.html#sentencetransformerrerank

index.as_query_engine(node_postprocessors=[SentenceTransformerRerank(model="BAAI/bge-base-reranker", top_n=3)])
I'll try the other approach you gave me, thank you very much.
Add a reply
Sign up and join the conversation on Discord