其他分享
首页 > 其他分享> > model=word2vec.Word2Vec(sentences, size=50) TypeError: __init__() got an unexpected keyword argument

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

作者:互联网

官网地址: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

标签:__,TypeError,word2vec,most,model,similar,size
来源: https://www.cnblogs.com/1gaoyu/p/14728898.html