Thanks Kevin. That helped to get started. But now my doubt is.
I trained the model with 100 documents but i want to find the similarity of a document that is separate from the documents that were used to train the model. How do i do that?
This is what i am doing. Am i doing it in correct way? Any advice will be helpful.
train_model = gensim.models.Doc2Vec(size=300, window=10, min_count=1, workers=11,alpha=0.025, min_alpha=0.025) # use fixed learning rate
train_model.build_vocab(train_sentences)
for epoch in range(10):
train_model.train(train_sentences)
train_model.alpha -= 0.002 # decrease the learning rate
train_model.min_alpha = model.alpha # fix the learning rate, no deca
train_model.train(train_sentences)
test_model = gensim.models.Doc2Vec(test_senteces,size=300, window=10, min_count=1, workers=11,alpha=0.025, min_alpha=0.025)
print(model.docvecs.most_similar([test_model.docvecs[0]]))
Thanks,
Varman