Reputation: 85
I am using gensim in python 3 as shown within image below
In line no 11 I am getting the following error:
Upvotes: 0
Views: 3997
Reputation: 11
Use in this way:
from gensim.models.deprecated.doc2vec import LabeledSentence
or better use:
from gensim.models.doc2vec import TaggedDocument
Upvotes: 0
Reputation: 15002
It's a deprecated import:
https://github.com/RaRe-Technologies/gensim/issues/1886
if you want to use LabeledSentenced you must import it from the deprecated section:
from gensim.models.deprecated.doc2vec import LabeledSentence
So you have to do this:
LabeledSentence = gensim.models.deprecated.doc2vec.LabeledSentence
Upvotes: 2