Skip to content
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

Merged
merged 11 commits into from
May 4, 2019

Conversation

Witiko
Copy link
Contributor

@Witiko Witiko commented Apr 23, 2019

This PR continues #2356 in reaction to #2455. The PR accomplishes the following:

  • Regain support for most_similar(…, topn=x), where bool(x) is False.
  • Document most_similar(…, topn=None).
  • Support topn=None in most_similar_cosmul, similar_by_word, and similar_by_vector.
  • Disable indexer in most_similar when topn is None, since indexers don't support topn=None.

Copy link
Collaborator

@mpenkov mpenkov left a 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:

  1. Objectively confirm that the bug has been fixed
  2. Prevent future regressions of the same bug

What do you think? Is it possible to test this new fix?

@mpenkov mpenkov added the bugfix label Apr 28, 2019
@Witiko
Copy link
Contributor Author

Witiko commented Apr 29, 2019

What do you think? Is it possible to test this new fix?

Thank you for the review. I added two unit tests in fbfe2d4 and fcfc638.

Copy link
Collaborator

@mpenkov mpenkov left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants