Word2Vec TypeError: __init__() got an unexpected keyword argument ‘size‘


在如下代码:

model = word2vec.Word2Vec(sentences=texts, size=300, window=3, workers=2)

中使用Word2Vec时报错:

TypeError: __init__() got an unexpected keyword argument 'size' 

解决方法:
将size改为vector_size
如下所示:

model = word2vec.Word2Vec(sentences=texts, vector_size=300, window=3, workers=2)

以上参考自:
https://blog.csdn.net/lcy6239/article/details/115786432
https://blog.csdn.net/lcy6239/article/details/115786432


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM