Closed robinp closed 2 years ago
In Gensim, there are two kinds of fastText models: trainable models (FastText
) and trained models (FastTextKeyedVectors
). A trained model is initially hidden as a wv
property of a trainable model, but can be saved and used separately. compress-fasttext
works only with trained models.
When converting from Facebook format, by default you get a trainable model, and you should extract a trained model from it. This means that you have to replace in your code
small_model = compress_fasttext.prune_ft_freq(orig)
with
small_model = compress_fasttext.prune_ft_freq(orig.wv)
and it will work.
Oh, what a silly mistake, thank you! I indeed see the use of .wv
in the saving code.
Hello again! Not sure if this is
compress-fasttext
orgensim
problem, but here we go:Getting the following
for the code
but when roundtripping the gensim model by save & load, it works:
env:
Thank you!