snownlp
snownlp copied to clipboard
关于训练
我这里现在有一批数据,我希望进行对这些数据进行情感分析,请问该怎么训练数据呢?
额,我已经找到怎么训练的了。
请问阁下是怎么训练的?
额,一直没注意这个,就是利用示例方法进行的,然后提供数据就行了,主要是数据不好搞,有什么问题可以加我QQ1213812243,另外,我不是作者哦。
from snownlp.sentiment import train, save
pos_docs = '/home/weiwu/.virtualenvs/graph/lib/python3.6/site-packages/snownlp/sentiment/pos.txt'
neg_docs = '/home/weiwu/.virtualenvs/graph/lib/python3.6/site-packages/snownlp/sentiment/neg.txt'
sentiment_model_path = './data/model/sentiment.marshal'
train(neg_docs, pos_docs)
save(sentiment_model_path)