-
-
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
Fix WordEmbeddingsKeyedVectors.most_similar #2461
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR.
I notice this PR fixes a bug. I think it would be helpful to introduce a unit test that reproduces the bug (fails on old code) and passes on new code. This will:
- Objectively confirm that the bug has been fixed
- Prevent future regressions of the same bug
What do you think? Is it possible to test this new fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you for your contribution.
This PR continues #2356 in reaction to #2455. The PR accomplishes the following:
most_similar(…, topn=x)
, wherebool(x)
isFalse
.most_similar(…, topn=None)
.topn=None
inmost_similar_cosmul
,similar_by_word
, andsimilar_by_vector
.indexer
inmost_similar
whentopn
isNone
, since indexers don't supporttopn=None
.