+
80
-

tensorflow如何实现语句情感分析?

tensorflow如何实现语句情感分析?


网友回复

+
0
-

使用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的概率 正向
		

我知道答案,我要回答