最大词汇量计数是否与手套模型

时间:2017-08-18 01:50:58

标签: python nlp stanford-nlp word-embedding

我已经通过此链接https://github.com/stanfordnlp/GloVe/tree/master/src实施了Glove模型。我已经指定max vocab参数为100000000,同时生成vocab.txt文件和单词矢量尺寸为100,同时训练模型并生成100维度的vectors.txt。 当我尝试在上面的链接中评估来自eval文件夹的word_analogy.py时,我收到以下错误

  File "C:\Users\JAYASHREE\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 714, in runfile
    execfile(filename, namespace)

  File "C:\Users\JAYASHREE\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "C:/Users/JAYASHREE/Documents/1 billion words/word_analogy.py", line 77, in <module>
    W, vocab, ivocab = generate()

  File "C:/Users/JAYASHREE/Documents/1 billion words/word_analogy.py", line 32, in generate
    W[vocab[word], :] = v

ValueError: cannot copy sequence with size 66 to array axis with dimension 100

我想知道在词汇表文件创建过程中指定的参数是否对矢量文件的维度有影响

0 个答案:

没有答案