Add "similarity_score_threshold"
option for MultiVectorRetriever
class
#19404
baptiste-pasquier
announced in
Ideas
Replies: 2 comments
-
I just realized (after spending some quality time with the sources) that I needed this one as well. Would also need to add the type to the |
Beta Was this translation helpful? Give feedback.
0 replies
-
pr #23539 for this feature |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked
Feature request
Add the ability to filter out documents with a similarity score less than a score_threshold in the
MultiVectorRetriever
.Motivation
The
VectorStoreRetriever
base class has a"similarity_score_threshold"
option forsearch_type
, which adds the ability to filter out any documents with a similarity score less than a score_threshold by calling the.similarity_search_with_relevance_scores()
method instead of.similarity_search()
.This feature is not implementend in the
MultiVectorRetriever
class.Proposal (If applicable)
In the
_get_relevant_documents
method ofMultiVectorRetriever
Replace :
langchain/libs/langchain/langchain/retrievers/multi_vector.py
Lines 63 to 68 in b20c264
With :
As in the
VectorStoreRetriever
base class :langchain/libs/core/langchain_core/vectorstores.py
Lines 673 to 687 in b20c264
Beta Was this translation helpful? Give feedback.
All reactions