def sentiment_analysis(sentence):
sentence = tb(sentence)
if (sentence.sentiment.polarity < -0.3):
return 'neg'
elif (sentence.sentiment.polarity > -0.3 and sentence.sentiment.polarity < 0.3):
return 'neutral'
else:
return 'pos'
评论列表
文章目录