(sentenceBERT) Why 'Doc2Vec object doesn't have 'encode' attribute and the associated solution

I am studying sentence embedding through Purva Huilgol’s article.
However, an error occurred while encoding the sentence in the content of the sentenceBERT.
The error is as follows: ‘Doc2Vec object has no attribute ‘encode’
If anyone knows the solution to this error, please reply.

First add link to article, code which makes problem (as text, not image) and FULL error mesage (starting at word Traceback)

© Copyright 2013-2021 Analytics Vidhya