facebookresearch / fastText

Library for fast text representation and classification.
https://fasttext.cc/
MIT License
25.85k stars 4.71k forks source link

Wrong file format! #413

Open huruifeng opened 6 years ago

huruifeng commented 6 years ago

Hi, I collected a list of words from PubMed Abstracts, and want to obtain the word vectors of these words. I have downloaded PubMed-w2v.bin as the model from http://bio.nlplab.org/#word-vectors. I ran the command: ./fasttext print-word-vectors PubMed-w2v.bin < term_list.txt

But I got an Error:

libc++abi.dylib: terminating with uncaught exception of type std::invalid_argument: PubMed-w2v.bin has wrong file format!
Abort trap: 6

Can anyone tell me what is wrong?

Thank you!

alberduris commented 6 years ago

The word-vectors from http://bio.nlplab.org/#word-vectors are "word2vec" word-vectors, not fasttext ones. You can load them using Gensim library indicating that the source is "word2vec".

huruifeng commented 6 years ago

@alberduris Thank you! I want to know How can I use it with the fastText?

zhanxw commented 6 years ago

Check https://radimrehurek.com/gensim/models/word2vec.html