简体   繁体   中英

Gensim: how to retrain doc2vec model using previous word2vec model

With Doc2Vec modelling, I have trained a model and saved following files:

1. model
2. model.docvecs.doctag_syn0.npy
3. model.syn0.npy
4. model.syn1.npy
5. model.syn1neg.npy

However, I have a new way to label the documents and want to train the model again. since the word vectors already obtained from previous version. Is there any way to reuse that model (eg, taking the previous w2v results as initial vectors for training)? Any one know how to do it?

I've figured out that, we can just load the model and continue to train.

model = Doc2Vec.load("old_model")
model.train(sentences)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM