shiyybua / NER

基于tensorflow深度学习的中文的命名实体识别
1.04k stars 400 forks source link

IndexError: index 2 is out of bounds for axis 0 with size 2 #21

Open jerryziyan opened 6 years ago

jerryziyan commented 6 years ago

Traceback (most recent call last): File "E:/python-files/NER/rnn.py", line 153, in embedding = load_word2vec_embedding(vocab_size) File "E:\python-files\NER\utils.py", line 264, in load_word2vec_embedding embeddings[index] = coefs # 将词和对应的向量存到字典里 IndexError: index 2 is out of bounds for axis 0 with size 2 请问一下作者,这个问题怎么解决啊,弄了半天,不知道怎么办?

ChallengerL commented 6 years ago

你好,我也是这个问题,请问解决了吗

szq1292718561 commented 6 years ago

我也是这个问题,请问怎么解决啊

bananagg commented 6 years ago

生成source_vocab.txt出了错,在utils.py中build_word_index方法中,把source.write(word + '\n')改为source.write(str(word) + '\n')

bluesky632 commented 5 years ago

谢谢bananagg的方法,解决了问题