-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add RAG LLMReranker #784
Conversation
""" | ||
========================================================================= | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
low priority: we can reorg these params to cli args and using structured params instead of raw key-value dict.
unit test fails
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
"query": "what is the capital of france?", | ||
"top_k": 5, | ||
"llm_params": {"temperature": 0.7}, | ||
"rerank_params": {"top_n": top_n} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the list of parameters that we can change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the parameters
class QueryRequest(BaseModel):
index_name: str
query: str
top_k: int = 10
llm_params: Optional[Dict] = None # Accept a dictionary for parameters
rerank_params: Optional[Dict] = None # Accept a dictionary for parameters
Reason for Change:
Code for adding simple
LLMReranker
This is common practice. Using the same LLM that is used for inference, to rerank RAG Results.
Sources:
https://docs.llamaindex.ai/en/stable/examples/workflow/rag/
https://www.llamaindex.ai/blog/using-llms-for-retrieval-and-reranking-23cf2d3a14b6
https://docs.llamaindex.ai/en/stable/module_guides/deploying/query_engine/usage_pattern/
https://docs.llamaindex.ai/en/stable/examples/node_postprocessor/LLMReranker-Gatsby/
https://medium.com/@abul.aala.fareh/different-reranking-techniques-in-llamaindex-6a56ed1f30a3
https://docs.llamaindex.ai/en/stable/examples/node_postprocessor/NVIDIARerank/