使用snownlp即可实现,代码如下:
#!/usr/local/python3/bin/python3
# -*- coding: utf-8 -*
from snownlp import SnowNLP
s = SnowNLP(u'你是个傻子')
print(s.sentiments)#positive的概率 正向
s = SnowNLP(u'今天心情好')
print(s.sentiments)#positive的概率 正向
网友回复
使用snownlp即可实现,代码如下:
#!/usr/local/python3/bin/python3
# -*- coding: utf-8 -*
from snownlp import SnowNLP
s = SnowNLP(u'你是个傻子')
print(s.sentiments)#positive的概率 正向
s = SnowNLP(u'今天心情好')
print(s.sentiments)#positive的概率 正向
网友回复