Skip to content

Instantly share code, notes, and snippets.

@rohit-gupta
Created September 2, 2017 10:58
Show Gist options
  • Save rohit-gupta/0247e917d7fb87f6b7fb8650fc342c01 to your computer and use it in GitHub Desktop.
Save rohit-gupta/0247e917d7fb87f6b7fb8650fc342c01 to your computer and use it in GitHub Desktop.
NLTK Sentiment Analysis Basics
from nltk.tokenize import sent_tokenize
text = """All of the MSM is fake news at this point. Their blind hatred of Trump has caused them to throw away what credibility they once had.
#DeathToTheMSM"""
sent_tokenize_list = sent_tokenize(text)
for sentence in sent_tokenize_list:
print sentence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment