Semantic Similarity
Measuring Similarity
Once you have embeddings, compare them:
Cosine Similarity: Measures angle between vectors. Range: [-1, 1] 1 = identical meaning 0 = unrelated -1 = opposite meaning
Implementation: cos_sim = np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))
Interpretation
What scores mean:
Applications
Duplicate Detection: Flag documents with similarity > 0.95
Clustering: Group documents by similarity
Search Ranking: Rank by relevance score
Recommendation: "Similar to what you read"