I have sentences stored as strings extracted from a document. I want to apply standard cosine similarity to sentences. How do i go about doing it?
Asked
Active
Viewed 432 times
2 Answers
0
Well you already have the formula on wikipedia. Each of the Ai
is a word so first you need to compute the frequency of words in your document . You need to be able to create a map of word occurrences. Then you represent each sentences by a vector of words and you can apply the formula.

UmNyobe
- 22,539
- 9
- 61
- 90
0
First of all, read about Term-Document matrix
Then, go for the Cosine calculation using Cosine Similarity calculator
If you are interested in text mining, then go for SVD and finally Latent Semantic Analysis

Debaditya
- 2,419
- 1
- 27
- 46