skip to navigation
skip to content

Not Logged In

text_comparer 0.0.2

Metric for comparing text

Text Comparer
=============

Uses cosine similarity to give a numerical evaluation of the similarity of two
texts (0 to 1).

This code has a companion blog-post here:
http://engineering.aweber.com/cosine-similarity/

Sample Usage
------------
```python
In [1]: from vectorizer import compare_texts

In [2]: compare_texts('Mary had a little shotgun.', 'Mary loves her shotgun')
Out[2]: 0.66666666666666663

In [3]: compare_texts('John loves Mary.', 'But Mary has a shotgun.')
Out[3]: 0.33333333333333331
```

The higher score in `2` implies that the first two sentences are more similar
than the second two.  A classic tale of the love-linked-list.
 
File Type Py Version Uploaded on Size
text_comparer-0.0.2.tar.gz (md5) Source 2014-01-04 2KB
  • Downloads (All Versions):
  • 2 downloads in the last day
  • 19 downloads in the last week
  • 134 downloads in the last month