0

我已经按照此链接https://github.com/stanfordnlp/GloVe/tree/master/src的实施实施了 Glove 模型。我将最大词汇参数指定为 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

我想知道在创建词汇文件时指定的参数是否对向量文件的尺寸有影响

4

0 回答 0