Reputation: 1575
I have a doc2vec
model build from my data, now I have a new sentence in run time which does not belong to the trained data set.
How can I build or predict a vector for this sentence from my model?
How should I handle unknown words in this sentence?
Upvotes: 2
Views: 1676
Reputation: 4898
Gensim (development version) seems to have a method to infer vectors of new sentences. Check out model.infer_vector(NewDocument)
method in https://github.com/gojomo/gensim/blob/develop/gensim/models/doc2vec.py
Upvotes: 4