Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 559 Bytes

README.md

File metadata and controls

9 lines (6 loc) · 559 Bytes

Document Similarity

Attempts to use cosine similarity to measure the similarity between two documents

Cosine Similarity

Converts two documents into vectors and calculates their similarity. The inner product space that measures the cosine angle between them is used to calculate similarity.

We define cosine similarity mathematically as the dot product of the vectors divided by their magnitude. For example, if we have two vectors, A and B, the similarity between them is calculated as:

$similarity(A, B) = cos(\alpha) = {A.B \over ||A|| ||B||}$