Word2vec
是deeplearning4j的一个很棒的工具。我成功地为一个语料库创建了一个向量 tutorial 。
现在的问题是如何用新句子更新模型,而不必从头开始重新构建模型。
对此的一些想法,这个方法有帮助吗?
public void trainSentence(List<VocabWord> sentence){}
这会更新模型吗?如果是,如何准备发送到该方法的句子?
最佳答案
是和否。在文档中here ,它提到:
Weights update after model serialization/deserialization was added. That is, you can update model state with, say, 200GB of new text by calling
loadFullModel
, addingTokenizerFactory
andSentenceIterator
to it, and callingfit()
on the restored model.
这意味着可以使用新语料库重新训练和更新模型权重。但词汇表中不会添加新单词。
检查代码和Javadoc here .
关于deeplearning4j:在线 Word2Vec 训练,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36989291/