Gensim: how to retrain doc2vec model using previous word2vec model

不羁岁月 提交于 2019-12-08 04:41:27

问题


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 (e.g., taking the previous w2v results as initial vectors for training)? Any one know how to do it?


回答1:


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

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


来源:https://stackoverflow.com/questions/39252207/gensim-how-to-retrain-doc2vec-model-using-previous-word2vec-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!