How to prepare new text with gensim doc2vec

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 big data to train the doc2vec model. And I want to use this preliminary model to teach a new text.

I just plan to train a new one with a preliminary model. How can i do this? The code above does not work ...

+4
source share

Source: https://habr.com/ru/post/1665596/


All Articles