RuntimeError: you must first build vocabulary before training the model

解决RuntimeError: you must first build vocabulary before training the model错误

查找解决方案,意思就是说你的数据集中的数量过少,解决方案有两种,扩大数据集的数量、另一个就是更改min_count的值例如:如果太少的话可以更改为

model=word2vec.Word2Vec(sentences, vector_size=100,min_count=1)
把这个更改了之后重新运行即可

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