0
0
NLPml~5 mins

Cosine similarity in NLP - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is cosine similarity?
Cosine similarity is a way to measure how similar two things are by looking at the angle between their vectors. It gives a value between -1 and 1, where 1 means exactly the same direction, 0 means no similarity, and -1 means opposite directions.
Click to reveal answer
beginner
How is cosine similarity calculated between two vectors?
Cosine similarity is calculated by dividing the dot product of two vectors by the product of their lengths (magnitudes). Formula: cosine_similarity = (A · B) / (||A|| * ||B||).
Click to reveal answer
beginner
Why is cosine similarity useful in text analysis?
Cosine similarity helps compare text by turning words into vectors and measuring how close their directions are. It ignores the length of the text, so it focuses on the meaning or topic similarity rather than size.
Click to reveal answer
beginner
What does a cosine similarity score of 0 mean?
A cosine similarity score of 0 means the two vectors are at a 90-degree angle, so they have no similarity or relation in direction.
Click to reveal answer
intermediate
Can cosine similarity be negative? What does that mean?
Yes, cosine similarity can be negative, down to -1. A negative score means the vectors point in opposite directions, showing opposite or very different meanings.
Click to reveal answer
What is the range of cosine similarity values?
A-0.5 to 0.5
B0 to 1
C-1 to 1
D0 to 100
Which part of the cosine similarity formula measures the length of a vector?
AMagnitude (length)
BDifference of vectors
CSum of elements
DDot product
Why is cosine similarity preferred over Euclidean distance for text similarity?
AIt ignores vector length, focusing on direction
BIt is faster to compute
CIt works only with numbers
DIt measures exact word matches
If two text vectors have a cosine similarity of 1, what does it mean?
AThey are completely different
BThey have no words in common
CThey are orthogonal
DThey are identical in direction
What does a cosine similarity of 0 indicate about two vectors?
AVectors are identical
BVectors are orthogonal (no similarity)
CVectors are opposite
DVectors have negative correlation
Explain in your own words what cosine similarity measures and why it is useful in comparing text data.
Think about how you compare two sentences by their meaning, not length.
You got /5 concepts.
    Describe how you would calculate cosine similarity between two word vectors step-by-step.
    Remember the formula: (A · B) / (||A|| * ||B||).
    You got /4 concepts.