Skip to content

Commit

Permalink
Test the difference between topn=0 and topn=None in most_similar.
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed Apr 29, 2019
1 parent cc14e72 commit fbfe2d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gensim/test/test_keyedvectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def test_most_similar_topn(self):
predicted = self.vectors.most_similar('war', topn=None)
self.assertEqual(len(predicted), len(self.vectors.vocab))

predicted = self.vectors.most_similar('war', topn=0)
self.assertEqual(len(predicted), 0)

def test_relative_cosine_similarity(self):
"""Test relative_cosine_similarity returns expected results with an input of a word pair and topn"""
wordnet_syn = [
Expand Down

0 comments on commit fbfe2d4

Please sign in to comment.