Planeshifter / node-word2vec

Node.js interface to the Google word2vec tool.
Apache License 2.0
348 stars 55 forks source link

.similarity(term1, term2) returns null for two identical terms instead of 1 #13

Closed suissemaxx closed 7 years ago

suissemaxx commented 7 years ago

Thank you very much for the node-port of w2v. Very helpful and very much appreciated!

A minor quirk I just stumbled upon: The similarity between two equal terms results in null rather than 1. I checked the same model in gensim and there I get a similarity of 1.0 as expected.

Why is that?

Planeshifter commented 7 years ago

Thank you for filing this issue! I changed the code to handle this case and have pushed a fix to GitHub and npm.