I am using a pre-trained doc2vec BOW model (AP-news). I am doing the following:
import gensim.models as g
start_alpha=0.01
infer_epoch=1000
model="\\apnews_dbow\\doc2vec.bin"
m = g.Doc2Vec.load(model)
text='this is a sample text'
vec=m.infer_vector(text,alpha=start_alpha, steps=infer_epoch)
But if I compute the vec again for the same text then I am getting a different vector representation of the same text. Why is this happening and how can I aviod this. I want to have the same vector returned if I give exactly the same text. I tried following this post but does not seem to help.
Aucun commentaire:
Enregistrer un commentaire