Gensim 3.4.0 word2vec不支持+ +''int'和'str'的操作数类型

时间:2018-03-20 12:22:12

标签: python word2vec gensim

我已将word2vec.py中的代码更改为:

\AppData\Local\Continuum\anaconda3\lib\site-packages\gensim\models\word2vec.py in reset_weights(self, hs, negative, wv)
   1417         for i in xrange(len(wv.vocab)):
   1418             # construct deterministic seed from word AND seed argument
-> 1419             wv.vectors[i] = self.seeded_vector( "".join(str(wv.index2word[i]),str(self.seed)), wv.vector_size)
   1420         if hs:
   1421             self.syn1 = zeros((len(wv.vocab), self.layer1_size), dtype=REAL)

但我收到错误:

TypeError: unsupported operand type(s) for +: 'int' and 'str'

在第1419行,箭头指向。我不明白当两个都在str()方法中时,操作数如何连接int和str?

我正在使用Anaconda环境,如果这在python3中很重要

0 个答案:

没有答案