-
Notifications
You must be signed in to change notification settings - Fork 16.7k
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
Fix Document Similarity Check with passed Threshold #6845
Fix Document Similarity Check with passed Threshold #6845
Conversation
… score threshold passed is the relevant score
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
@pablocastro @farzad528 Kindly request you to please take a look. |
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.
self.relevance_score_fn is relevant for _similarity_search_with_relevance_scores
@Sidchat95 happy to help but you may have the wrong folks, @farzad528 and I work on Azure Cognitive Search, not on FAISS. |
Hi @hwchase17 , as I agree that self.relevance_score_fn is majorly used for _similarity_search_with_relevance_scores function but it is also effecting this stage as well. Consider the following scenario where we have a vectorstore built out of FAISS vectorstore:
The steps called are:
|
Thanks no problem. My bad ! |
@hwchase17 Request you to please look into this and approve the workflows |
8c047c8
to
d5f4f92
Compare
updated so only affects similarity_search_with_relevance_score |
Thanks @baskaryan for the collaboration but changing it in similarity_search_with_relevance_score in FAISS renders Line 227 to 238 in method similarity_search_with_score_by_vector completely useless as this would always pop the threshold from the arguments. Should we remove the redundant code then ? |
it's useless if someone calls |
Agreed. Thank you @baskaryan . Can we merge this now? I do not have the permissions to merge this actually and seems all checks have passed? |
done, thanks @Sidchat95! |
Thank you @baskaryan as a part of this PR, can I get the recognition for this twitter account if possible for this? @procoretech |
Converting the Similarity obtained in the similarity_search_with_score_by_vector method whilst comparing to the passed
threshold. This is because the passed threshold is a number between 0 to 1 and is already in the relevance_score_fn format.
As of now, the function is comparing two different scoring parameters and that wouldn't work.
Dependencies
None
Issue:
Different scores being compared in similarity_search_with_score_by_vector method in FAISS.
Tag maintainer
@hwchase17