model=word2vec.Word2Vec(sentences, size=50) TypeError: __init__() got an unexpected keyword argument 'size'

官网地址:https://radimrehurek.com/gensim/models/word2vec.html#gensim.models.word2vec.Text8Corpus

原因就是在新版的Word2vec里边一些具体的参数进行了更新,所以显示参数错误

解决方案

size -> vector_size

AttributeError: 'Word2Vec' object has no attribute 'most_similar'

model.most_similar -> model.wv.most_similar

model.n_similarity -> model.wv.similarity

posted on 2021-05-04 09:19  一往无前!  阅读(1424)  评论(0编辑  收藏  举报