-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Normalize negative scores for text_similarity_reranker retriever #120930
Normalize negative scores for text_similarity_reranker retriever #120930
Conversation
Documentation preview: |
Hi @pmpailis, I've created a changelog YAML for you. |
…b.com:pmpailis/elasticsearch into properly_handle_negative_scores_in_retrievers
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
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.
This is looking good to me. One minor question on the scoredoc query.
server/src/main/java/org/elasticsearch/search/retriever/rankdoc/RankDocsQuery.java
Show resolved
Hide resolved
...pack/inference/rank/textsimilarity/TextSimilarityRankFeaturePhaseRankCoordinatorContext.java
Outdated
Show resolved
Hide resolved
…b.com:pmpailis/elasticsearch into properly_handle_negative_scores_in_retrievers
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.
🥾
🐛
Bug squashed
💔 Backport failed
You can use sqren/backport to manually backport by running |
It is valid for some rerankers to return negative scores, so in this PR we add a normalization step for the final scores, to ensure that all scores are >=0, as Lucene assumes that all scores should be positive.
The normalization function that we'll apply is the following:
which will ensure that all positive scores lie in the
[1, inf)
while negative values will be projected to(0, 1)
Closes #120201