0

I m trying to align my model with fasttext unsupervised.py https://github.com/facebookresearch/MUSE. I trained my model with fasttext and I got the binary file model.bin. When I use unsupervised.py I get the

error: ValueError: model.bin has wrong file format

What is wrong? Do I have to have a .vec file? How to get it?

Buddy Bob
  • 5,829
  • 1
  • 13
  • 44
Monica
  • 3
  • 2

2 Answers2

1

For information about the difference between .bin and .vec files, you can read this question.

In any case, MUSE expects .vec files.

If you want to convert a .bin file to a .vec file, this answer will probably help you.

0

The Puthon Gensim package can load Facebook FastText .bin models with its FastText.load_facebook_model() method:

ft_model = FastText.load_facebook_model(path_to_bin)

Then, save out just the vectors from the model's included .wv word-vector as a plain-text .vec file using the KeyedVectors' method .save_word2vec_format()with thebinary=False` option:

ft_model.wv.save_word2vec_format('ft_model.vec')
gojomo
  • 52,260
  • 14
  • 86
  • 115