Skip to content

Commit

Permalink
fix a test for oov similarity
Browse files Browse the repository at this point in the history
  • Loading branch information
David Dale committed Mar 3, 2020
1 parent 1cc6c4a commit e7f555c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gensim/test/test_fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ def test_oov_similarity(self):
word = 'someoovword'
most_similar = self.test_model.wv.most_similar(word)
top_neighbor, top_similarity = most_similar[0]
v1 = self.test_model.vw[word]
v2 = self.test_model.vw[top_neighbor]
v1 = self.test_model.wv[word]
v2 = self.test_model.wv[top_neighbor]
top_similarity_direct = self.test_model.wv.cosine_similarity(v1, v2.reshape(1, -1))[0]
self.assertAlmostEqual(top_similarity, top_similarity_direct)

Expand Down

0 comments on commit e7f555c

Please sign in to comment.