Skip to content

Instantly share code, notes, and snippets.

@wfng92
Created May 4, 2021 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wfng92/76863e680346fc3666980c893181f541 to your computer and use it in GitHub Desktop.
Save wfng92/76863e680346fc3666980c893181f541 to your computer and use it in GitHub Desktop.
from snownlp import SnowNLP
text = SnowNLP(u'这个产品很好用,这个产品不好用,这个产品是垃圾,这个也太贵了吧,超级垃圾,是个垃圾中的垃圾')
sent = text.sentences
for sen in sent:
s = SnowNLP(sen)
print(sen, s.sentiments)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment