Skip to content

Instantly share code, notes, and snippets.

@wfng92
Created June 18, 2019 04:47
Show Gist options
  • Select an option

  • Save wfng92/bf6793de9300902758a7d7f402d260a1 to your computer and use it in GitHub Desktop.

Select an option

Save wfng92/bf6793de9300902758a7d7f402d260a1 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(s.sentiments)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment