Cosine similarity:

image.png

image.png

image.png

image.png

Summarize:

Two phrases nothing in common → cosine similarity 0

Exactly same → cosine similarity 1

Some overlap → cosine similarity between 0 and 1

image.png

sigma → short hand notation for adding up things

i → index we are working on

n → number of different words in the phrases

A,B → refer to phrases

image.png