Skip to content

Filter Embedding Retriever results by score. #3995

Answered by bogdankostic
jais001 asked this question in Questions
Discussion options

You must be logged in to vote

Hi @JaisVJ, we don't have a built-in functionality for this but should be able to easily filter the results by score like this:

score_threshold = <YOUR-DESIRED-THRESHOLD>
documents = pipeline.run(query=<YOUR-QUERY>)
filtered_documents = [doc for doc in documents if doc.score > score_threshold]

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jais001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants