Difference between Fasttext .vec and .bin file

Bhushan Pant picture Bhushan Pant · Nov 5, 2017 · Viewed 9.2k times · Source

I recently downloaded fasttext pretrained model for english. I got two files:

  1. wiki.en.vec
  2. wiki.en.bin

I am not sure what is the difference between the two files?

Answer

fnl picture fnl · Mar 23, 2018

The .vec files contain only the aggregated word vectors, in plain-text. The .bin files in addition contain the model parameters, and crucially, the vectors for all the n-grams.

So if you want to encode words you did not train with using those n-grams (FastText's famous "subword information"), you need to find an API that can handle FastText .bin files (most only support the .vec files, however...).