-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WMD Earth mover Distance for sentences that contain a single word return inf #979
Comments
This is caused by the np_sum(distance_matrix) is equal to 0 when the distance matrix is a 1*1 matrix https://github.com/RaRe-Technologies/gensim/blob/develop/gensim/models/word2vec.py#L1415 |
Thanks for highlighting this. What would be a better value to return? |
@tmylk, thanks for your replay. I suggest it should return float 0.0. If you agree, I have attached a pull request that deals with it. Please take a look. |
Fixed in #986 |
`import gensim
from reuse import load_model
if name == "main":
print "gensim version: %s" % gensim.version
Will ##output:
The text was updated successfully, but these errors were encountered: