Replies: 1 comment 7 replies
-
Hey there, @ak4hcl! 👋 I'm here to assist you with bugs, questions, and becoming a contributor. Let's squash those bugs together! To set a threshold for an ensemble retriever and filter hybrid search results by score, you can modify your retrievers to return scores and then filter the results based on these scores. Here’s how you can achieve this:
By following these steps, you can set a threshold to filter the results by their score, ensuring that casual messages or greetings are filtered out [1][2][3]. |
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
I want to avoid RAG for casual message by user or greetings like "hey there!", "hi", hello", "What's the time now?" and so on.
I can only do it by setting the threshold to filter the results by their score. But -neither ensemble retriever nor BM25 retriever are returning score while I search. Please suggest some ideas.
System Info
# pip freeze | grep langchain
langchain==0.2.5
langchain-chroma==0.1.1
langchain-community==0.2.5
langchain-core==0.2.9
langchain-openai==0.1.8
langchain-text-splitters==0.2.1
langchainhub==0.1.20
Windows/Linux
Python version: 3.11.9
Beta Was this translation helpful? Give feedback.
All reactions