From af986a0ebcd4f9fc8e4a76f7a67a906ce86a852e Mon Sep 17 00:00:00 2001 From: Bright Chang <75425626@qq.com> Date: Thu, 27 Dec 2018 17:30:06 +0800 Subject: [PATCH] Problem about saving the trained word2vec In the newest gensim, please use the KeyedVectors --- model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model.py b/model.py index d59f46b..d755edf 100644 --- a/model.py +++ b/model.py @@ -259,7 +259,7 @@ def create_gensim_files(self, sess, model_folder, ind2emoj, out_dim): f.write('\n') f.close() - e2v = gs.Word2Vec.load_word2vec_format(txt_path, binary=False) + e2v = gs.KeyedVectors.load_word2vec_format(txt_path, binary=False) e2v.save_word2vec_format(bin_path, binary=True) return e2v