Skip to content

Instantly share code, notes, and snippets.

@roopalgarg
Created May 24, 2017 21:19
Show Gist options
  • Save roopalgarg/b2e2c79e40c770b0cb67527d99961d90 to your computer and use it in GitHub Desktop.
Save roopalgarg/b2e2c79e40c770b0cb67527d99961d90 to your computer and use it in GitHub Desktop.
access nltk's twitter corpus
from nltk.corpus import twitter_samples
from nltk.twitter.util import json2csv
twitter_samples.fileids()
strings = twitter_samples.strings('negative_tweets.json')
for string in strings[:15]:
print(string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment