Filter Embedding Retriever results by score. #3995
-
I am using Embedding Retriever with Elastic Document store. Is there any parameter to filter the results of the retriever by the score? That is, all results that are greater than or equal to the provided score are displayed. |
Beta Was this translation helpful? Give feedback.
Answered by
bogdankostic
Jan 30, 2023
Replies: 1 comment
-
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] |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jais001
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: