ewfian / faiss-node

Node.js bindings for faiss
https://www.npmjs.com/package/faiss-node
MIT License
107 stars 10 forks source link

Add the option to get the cosine similarity value (score) for each returned label in the search function #28

Open HasanYousef opened 1 year ago

HasanYousef commented 1 year ago

Hi, it will be awesome if we get the value of the cosine similarity score to compare the returned values in the search function.

For example, if the search function got called with vector = x and k = 4 and returned [5, 2, 0, 3], currently we can't tell how similar vector 5 is to the query vector x compared to how similar vector 2 is to the query vector x.