epfml / sent2vec

General purpose unsupervised sentence representations
Other
1.19k stars 256 forks source link

the predicted vectors are all 0. #52

Closed cs329yangzhong closed 6 years ago

cs329yangzhong commented 6 years ago

I successfully install the sent2vec python module globally. However, while I tried to predict the vector using the wiki_unigram model, the output is a 600 dim vector with all element 0. Does anyone know what's wrong with it ? Thanks a lot! Meanwhile, when I tried the cml, ./fasttext print-sentence-vectors wiki_unigrams.bin < test.txt, There was an assertion error: Assertion failed: (counts.size() == osz_), function setTargetCounts, file src/model.cc, line 226. Abort trap: 6

Code below: import sent2vec model = sent2vec.Sent2vecModel() model.load_model('wiki_unigrams.bin' print(model) emb = model.embed_sentence(" I do not know why you said so . ")
print(emb)

output: `[[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.

                                              1. 0.
                                              1. 0.
                                              1. 0.
                                              1. 0.
                                              1. 0.
                1. ...`
mpagli commented 6 years ago

What is your OS ?

cs329yangzhong commented 6 years ago

Mac OS, mojave

cs329yangzhong commented 6 years ago

The issues was solved by moving to linux platform. Thanks!