-
Notifications
You must be signed in to change notification settings - Fork 2k
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: MetaField Ranker #6189
feat: MetaField Ranker #6189
Conversation
Co-authored-by: ZanSara <[email protected]>
Hey @domenicocinque , thanks for opening this PR. Would you please provide a bit more context about using this component? See, for example For the release note CI failure, you need to add a release note with |
Hi @vblagoje, thanks for the fast response. I added the |
@domenicocinque Your explanation helped me a lot to understand the use case of this component. However, what I'm not 100% sure about is whether this component should be integrated into our core packages or included as a valuable community integration. Let me consult internally and we'll get back to you soon. |
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.
@domenicocinque looks quite solid already. I left one comment that I think should improve code readability and performance as well
@domenicocinque great work, thank you. One last request - let's add a unit test for the non-happy path in |
@dfokina I don't expect any more changes for this PR after @domenicocinque's next commit. Please have a look at it after he commits his last change and make any pydoc corrections 🙏 |
Thanks for the update @domenicocinque and for this overall valuable contribution! @dfokina have a pass now, make any needed changes, and we are ready to 🚢 |
All done from my side too! 🚀 |
Related Issues
Proposed Changes:
Why:
To allow users to rank documents by a relevant metadata field after having used a retriever.
How can it be used:
The example shows how the component can be used to rank documents by combining a meta field of choice ("rating" in this case) and the score of the retriever.
How did you test it?
Tested locally and with unit tests
Notes for the reviewer
The implementation is based on the Recentness Ranker. However I made some changes such as renaming the "score" ranking method to "linear_score" to make it more specific. Moreover I separated the logic that reranks the results in another function, in order to make it possible to inherit from this class for the implementation of a Recentness Ranker in Haystack 2.0
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.