【发布时间】:2017-12-21 16:27:43
【问题描述】:
我正在为 600000 行句子尝试 doc2vec,我的代码如下:
model = gensim.models.doc2vec.Doc2Vec(size= 100, min_count = 5,window=4, iter = 50, workers=cores)
model.build_vocab(res)
model.train(res, total_examples=model.corpus_count, epochs=model.iter)
#len(res) = 663406
#length of unique words 15581
print(len(model.wv.vocab))
#length of doc vectors is 10
len(model.docvecs)
# each of length 100
len(model.docvecs[1])
我如何解释这个结果?为什么向量的长度只有 10,每个大小为 100?当 'res' 的长度为 663406 时,它没有意义。我知道这里有问题。
在Understanding the output of Doc2Vec from Gensim package 中,他们提到docvec 的长度由'size' 决定,这并不清楚。
【问题讨论】: