sent2vec icon indicating copy to clipboard operation
sent2vec copied to clipboard

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

Open taojin1992 opened this issue 5 years ago • 2 comments

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.

taojin1992 avatar Sep 17 '19 23:09 taojin1992

Very weird, which system are you on?

mpagli avatar Mar 06 '20 11:03 mpagli

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!

ding-si-han avatar Aug 05 '20 03:08 ding-si-han