Technical requirements
We need to install Gensim 3.8.3:
pip install gensim==3.8.3
Other versions of Gensim may incur an error message for Doc2Vec:
AttributeError: 'Doc2Vec' object has no attribute 'dv'
After you installed Gensim 3.8.3, import the following:
from gensim.models.doc2vec import Doc2Vec, TaggedDocument
You can find code files for this chapter on GitHub at https://github.com/PacktPublishing/The-Handbook-of-NLP-with-Gensim/tree/main/Chapter08.