Skip to content

Commit

Permalink
Refactoring _create_and_save_fb_model method name (piskvorky#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
lopusz committed Jan 8, 2020
1 parent 971bfa6 commit f8a7d47
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gensim/test/test_fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ def _run(self, fin):
self.assertTrue(np.allclose(_ARRAY, array))


def _create_and_save_test_model(fname, model_params):
def _create_and_save_fb_model(fname, model_params):
model = FT_gensim(**model_params)
lee_data = LineSentence(datapath('lee_background.cor'))
model.build_vocab(lee_data)
Expand All @@ -1329,7 +1329,7 @@ def _check_roundtrip(self, sg):

with temporary_file("roundtrip_model_to_model.bin") as fpath:

model_trained = _create_and_save_test_model(fpath, model_params)
model_trained = _create_and_save_fb_model(fpath, model_params)

model_loaded = gensim.models.fasttext.load_facebook_model(fpath)

Expand Down Expand Up @@ -1385,7 +1385,7 @@ def _check_roundtrip_file_file(self, sg):

with temporary_file("roundtrip_file_to_file1.bin") as fpath1, \
temporary_file("roundtrip_file_to_file2.bin") as fpath2:
_create_and_save_test_model(fpath1, model_params)
_create_and_save_fb_model(fpath1, model_params)
model = gensim.models.fasttext.load_facebook_model(fpath1)
gensim.models.fasttext.save_facebook_model(model, fpath2)
self.assertEqual(_read_binary_file(fpath1), _read_binary_file(fpath2))
Expand Down Expand Up @@ -1483,7 +1483,7 @@ def _check_load_fasttext_format(self, sg):
"workers": 1}

with temporary_file("load_fasttext.bin") as fpath:
model = _create_and_save_test_model(fpath, model_params)
model = _create_and_save_fb_model(fpath, model_params)
wv = _read_wordvectors_using_fasttext(fpath, model.wv.index2word)

for i, w in enumerate(model.wv.index2word):
Expand Down

0 comments on commit f8a7d47

Please sign in to comment.