From bc8505e43de210e82ebfd4394836e836b811f840 Mon Sep 17 00:00:00 2001 From: Kento NOZAWA Date: Mon, 5 Feb 2018 16:54:38 +0900 Subject: [PATCH] Fix example block for `gensim.models.Word2Vec` (#1876) --- gensim/models/word2vec.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 gensim/models/word2vec.py diff --git a/gensim/models/word2vec.py b/gensim/models/word2vec.py old mode 100644 new mode 100755 index 1e26158310..50be048f4a --- a/gensim/models/word2vec.py +++ b/gensim/models/word2vec.py @@ -36,14 +36,14 @@ array([-0.00449447, -0.00310097, 0.02421786, ...], dtype=float32) The word vectors can also be instantiated from an existing file on disk in the word2vec C format -as a KeyedVectors instance:: +as a KeyedVectors instance. - NOTE: It is impossible to continue training the vectors loaded from the C format because hidden weights, - vocabulary frequency and the binary tree is missing:: +NOTE: It is impossible to continue training the vectors loaded from the C format because hidden weights, +vocabulary frequency and the binary tree is missing:: - >>> from gensim.models import KeyedVectors - >>> word_vectors = KeyedVectors.load_word2vec_format('/tmp/vectors.txt', binary=False) # C text format - >>> word_vectors = KeyedVectors.load_word2vec_format('/tmp/vectors.bin', binary=True) # C binary format + >>> from gensim.models import KeyedVectors + >>> word_vectors = KeyedVectors.load_word2vec_format('/tmp/vectors.txt', binary=False) # C text format + >>> word_vectors = KeyedVectors.load_word2vec_format('/tmp/vectors.bin', binary=True) # C binary format You can perform various NLP word tasks with the model. Some of them