在如下代碼:
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
