๐Ÿ“ Cosine similarity

= the โšซ๏ธ Dot-product of two vectors, scaled by their magnitude (= ๐Ÿ“ Vector length) โ†’ difference between two vectors in terms of their angle

Formula

  • : vector 1
  • : vector 2

Meaning

  • Result: in range [-1, 1]
  • -1: opposite direction
  • +1: same direction
  • 0: orthogonal

๐Ÿ”— Links

โšซ๏ธ Dot-product ๐Ÿ“ Vector length ใ€ฐ๏ธ Word embedding