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)
把这个更改了之后重新运行即可
原文地址:https://www.cnblogs.com/1gaoyu/p/14728860.html