epfml / sent2vec

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

name 'stdvector_base' is not defined when calling sent2vec.Sent2vecModel.embed_sentence() #88

Open taojin1992 opened 5 years ago

taojin1992 commented 5 years ago

NameError Traceback (most recent call last)

in 3 for line in pos: 4 print(line) ----> 5 sentence_vector = model.embed_sentence(line) 6 pos_arrays[i] = sentence_vector 7 pos_labels[i] = 1 src/sent2vec.pyx in sent2vec.Sent2vecModel.embed_sentence() src/sent2vec.pyx in sent2vec.Sent2vecModel.embed_sentences() src/sent2vec.pyx in sent2vec.vector_wrapper.asarray() NameError: name 'stdvector_base' is not defined I went to the code of stdvector_base and only see "pass" in the class definition. I added the default constructor but doesn't help to resolve the issue. Any suggestion? This April, I could run it successfully but it cannot work now.
mpagli commented 4 years ago

Very weird, which system are you on?

ding-si-han commented 4 years ago

Had the same issue as well, turns out it was because the input (line in the above example) was an empty Python list. Resolved by filling the list with a placeholder string. Hope that helps!