How to train a new text with gensim doc2vec

1.8k views Asked by At
sentences=gensim.models.doc2vec.TaggedLineDocument("raw_docs.txt")
model=gensim.models.Doc2Vec(sentences,min_count=1,iter=100)
sentence=TaggedDocument(words=[u'为了'],tags=[u'T1'])
sentences1=[sentence]
model.build_vocab(sentences1,update=True)
model.train(sentences1)
print "successful!"

I want to use a big data to train a doc2vec model. And I want to use this pretrained model to train a new text.

I only expect to train the new one with a pretrained model. How can I do that?The code above doesn't work...

0

There are 0 answers