Skip to content

Commit

Permalink
fasttext: Update expected OOV vectors in tests
Browse files Browse the repository at this point in the history
These had to be updatened, since after the modifications to the
`word_vector` method, we no longer normalize by the number of ngrams,
but instead by the number of bucketed ngram hashes
  • Loading branch information
jbaiter committed Jan 13, 2018
1 parent dec95ab commit 779180e
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions gensim/test/test_fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ def test_load_fasttext_format(self):
# vector for oov words are slightly different from original FastText due to discarding unused ngrams
# obtained using a modified version of ./fasttext print-word-vectors lee_fasttext_new.bin
expected_vec_oov = [
-0.23825,
-0.58482,
-0.22276,
-0.41215,
0.91015,
-1.6786,
-0.26724,
0.58818,
0.57828,
0.75801
-0.21929,
-0.53778,
-0.22463,
-0.41735,
0.71737,
-1.59758,
-0.24833,
0.62028,
0.53203,
0.77568
]
self.assertTrue(np.allclose(model["rejection"], expected_vec_oov, atol=1e-4))

Expand Down Expand Up @@ -205,16 +205,16 @@ def test_load_fasttext_new_format(self):
# vector for oov words are slightly different from original FastText due to discarding unused ngrams
# obtained using a modified version of ./fasttext print-word-vectors lee_fasttext_new.bin
expected_vec_oov = [
-0.53378,
-0.19,
0.013482,
-0.86767,
-0.21684,
-0.89928,
0.45124,
0.18025,
-0.14128,
0.22508
-0.49111,
-0.13122,
-0.02109,
-0.88769,
-0.20105,
-0.91732,
0.47243,
0.19708,
-0.17856,
0.19815
]
self.assertTrue(np.allclose(new_model["rejection"], expected_vec_oov, atol=1e-4))

Expand Down

0 comments on commit 779180e

Please sign in to comment.