-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding Maximum Margin Relevance Ranker (#8554)
* initial import * linting * adding MRR tests * adding release notes * fixing tests * adding linting ignore to cross-encoder ranker * update docstring * refactoring * making strategy Optional instead of Literal * wip: adding unit tests * refactoring MMR algorithm * refactoring tests * cleaning up and updating tests * adding empty line between license + code * bug in tests * using Enum for strategy and similarity metric * adding more tests * adding empty line between license + code * removing run time params * PR comments * PR comments * fixing * fixing serialisation * fixing serialisation tests * Update haystack/components/rankers/sentence_transformers_diversity.py Co-authored-by: Daria Fokina <[email protected]> * Update haystack/components/rankers/sentence_transformers_diversity.py Co-authored-by: Daria Fokina <[email protected]> * Update haystack/components/rankers/sentence_transformers_diversity.py Co-authored-by: Daria Fokina <[email protected]> * Update haystack/components/rankers/sentence_transformers_diversity.py Co-authored-by: Daria Fokina <[email protected]> * Update haystack/components/rankers/sentence_transformers_diversity.py Co-authored-by: Daria Fokina <[email protected]> * Update haystack/components/rankers/sentence_transformers_diversity.py Co-authored-by: Daria Fokina <[email protected]> * Update haystack/components/rankers/sentence_transformers_diversity.py Co-authored-by: Daria Fokina <[email protected]> * fixing tests * PR comments * PR comments * PR comments * PR comments --------- Co-authored-by: Daria Fokina <[email protected]>
- Loading branch information
1 parent
a8eeb20
commit b5a2fad
Showing
4 changed files
with
341 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
releasenotes/notes/add-maximum-margin-relevance-ranker-9d6d71c6a408c6d1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
enhancements: | ||
- | | ||
Added the Maximum Margin Relevance (MMR) strategy to the `SentenceTransformersDiversityRanker`. MMR scores are calculated for each document based on their relevance to the query and diversity from already selected documents. |
Oops, something went wrong.