Skip to content
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

Add flag to disable scaling scores to probabilities #2454

Merged
merged 18 commits into from
May 2, 2022

Conversation

tstadel
Copy link
Member

@tstadel tstadel commented Apr 25, 2022

Proposed changes:

  • add scale_score flag to retrievers
  • propagate scale_score down to document stores' query_by_embedding
  • consolidate usage of scaling function throughout document stores
  • adjust docstrings of Document's score reflecting the possibility of non-unit-interval values

Usage:

  • as plain retriever:
EmbeddingRetriever(
        document_store=document_store_with_docs, embedding_model="sentence-transformers/paraphrase-MiniLM-L3-v2", scale_score=False
    )
  • via pipeline params:
pipeline.run(query="who am I?", params={"scale_score": False})

Status (please check what you already did):

  • First draft (up for discussions & feedback)
  • Final code
  • Added tests
  • Updated documentation

@tstadel tstadel added the topic:predictions format of predictions, score, probability ... label Apr 28, 2022
Copy link
Member

@julian-risch julian-risch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check milvus support of cosine similarity and the changes in haystack/document_stores/milvus2.py with @MichelBartels before merging. All other changes look good to me. 👍

@tstadel tstadel merged commit 7d6b3fe into master May 2, 2022
@tstadel tstadel deleted the disable_score_scaling branch May 2, 2022 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:predictions format of predictions, score, probability ... topic:retriever
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants