我已将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中很重要