No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
node_modules/natural
tests
.gitignore
README.md
package.json

README.md

Measuring similarity of sentences

The Jaccard Index itself calculates the similarity/diversity of two sample sets.

This module measure the similarity between senteces, based on the words in common (some of the stop words are excluded).

It is build on top of the "Natural" module - library for natural language processing.

The result should be between 0 and 1.

You can find more information about the algorithm on Wikipedia

Example

Input:

"This is one sentence."

"This is another sentence."

Result: 0.6

##Installation

npm install jaccard-similarity-sentences

##Usage

var jaccard = require ('jaccard-similarity-sentences');

var sentence1 = 'This is one sentence.';
var sentence2 = 'This is another sentence.';

var measure = jaccard.jaccardSimilarity(sentence1, sentence2);

console.log(measure);

License

MIT