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