BUPTLdy / Sentiment-Analysis

Chinese Shopping Reviews sentiment analysis
http://buptldy.github.io/2016/07/20/2016-07-20-sentiment%20analysis/
351 stars 168 forks source link

运行遇到错误 #13

Open wanesta opened 6 years ago

wanesta commented 6 years ago

您好,我运行了主函数里面注释掉掉部分,在函数get_train_vecs 里面得到这个错误·~~。 get_train_vecs(x_train,x_test) #计算词向量并保存为train_vecs.npy,test_vecs.npy File "code/Sentiment_svm.py", line 55, in get_train_vecs imdb_w2v.train(x_train) File "/data/home/guanggao/anaconda2/lib/python2.7/site-packages/gensim/models/word2vec.py", line 813, in train raise ValueError("You must specify either total_examples or total_words, for proper alpha and progress calculations. The usual value is total_examples=model.corpus_count.") ValueError: You must specify either total_examples or total_words, for proper alpha and progress calculations. The usual value is total_examples=model.corpus_count.

Aurora1979 commented 6 years ago

改为imdb_w2v.train(x_train, total_examples=imdb_w2v.corpus_count, epochs=imdb_w2v.iter)