Open OmarShehata opened 5 months ago
Hello!
With version 2.2.2
, your approach is indeed the correct one. However, since 3.0.0
there is a new similarity
method to abstract away the similarity score computation. Behind the scenes, it still does cosine similarity by default.
The documentation and examples have been updated for the most recent sentence-transformers
version.
Using version
2.2.2
. Several places in the docs show computing similarity like this (example here https://www.sbert.net/index.html)however, this produces an error:
I think the correct form is:
I can open a PR to fix this across the docs, but wanted to check in first that this is intentional/expected. It does appear to be defined here:
https://github.com/UKPLab/sentence-transformers/blob/e5c15a51a72a5432370c4daa1d0ef7be67b4ce50/sentence_transformers/SentenceTransformer.py#L607