Skip to content

Simple document similarity module implemented in NodeJS

License

Notifications You must be signed in to change notification settings

MSVCode/doc-similarity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

doc-similarity

NodeJS simple document similarity module. Support some popular similarity measurement.

NPM package

  • Run npm install doc-similarity --save
  • Require it in your project const docSimilarity = require('doc-similarity');
  • Call it docSimilarity.wordFrequencySim(document1, document2, [similarityFunction])
  • Example docSimilarity.wordFrequencySim("Hello World", "Hello John", docSimilarity.cosineSim)

Similarity function is optional parameter, default set to Cosine Similarity. It could be replaced by any user-created function.

Demo run in project folder

  • Make sure to install the npm modules first npm install
  • In the project, run node ./src/demo.js

Current Features (0.0.1)

Word Weighting

  • Word Frequency

Similarity Measure

  • Cosine
  • Jaccard

To-do

  • TF-IDF distance
  • HTF-IDF distance
  • Browser compatibility

Releases

No releases published

Packages

No packages published