midNLP

What is cosine similarity in NLP?

Updated May 17, 2026

Short answer

Cosine similarity measures similarity between two vectors.

Deep explanation

It computes cosine of angle between vectors, useful in embedding comparisons regardless of magnitude.

Real-world example

Document similarity in search engines.

Common mistakes

  • Confusing it with Euclidean distance.

Follow-up questions

  • Why normalize vectors?
  • Where is cosine similarity used?

More NLP interview questions

View all →