Using Cosine Similarity is a common method to calculate Semantic Textual Similarity. And it is particularly useful when comparing Sentence Embeddings provided by the Universal Sentence Encoder.

However, the loss function used for training the USE model is based on Angular Difference, which can explain why Cosine Similiarity would be an effective alternative:

As shown Eq. 1, we first compute the cosine similarity of the two sentence embeddings and then use arccos to convert the cosine similarity into an angular distance. (...) We find that using a similarity based on angular distance performs better on average than raw cosine similarity

Now, what about other Vectorial Representations of Text (not necessarily restricted to Sentence Embeddings), such as TF-IDF or even Probability Vectors (using the Probability Distributions as values for its dimensions)? Would Cosine Similarity be similarly effective to calculate Semantic Text Similarity across two vectors created using those mechanisms?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.