mirror of https://github.com/hwchase17/langchain
Fix Pinecone cosine relevance score (#8920)
Fixes: #8207 Description: Pinecone returns scores (not distances) with cosine similarity. The values according to the docs are [-1, 1], although I could never reproduce negative values. This PR ensures that the score returned from Pinecone is preserved, rather than inverted, so the most relevant documents can be filtered (eg when using similarity thresholds) I'll leave this as a draft PR as I couldn't run the tests (my pinecone account might not be enough - some errors were being thrown around namespaces) so hopefully someone who _can_ will pick this up. Maintainers: @rlancemartin, @eyurtsev --------- Co-authored-by: Erick Friis <erick@langchain.dev>pull/13302/head
parent
2e42ed5de6
commit
ff19a62afc
Loading…
Reference in New Issue