Skip to content

Instantly share code, notes, and snippets.

@clintmjohnson
Created October 18, 2017 19:46
Show Gist options
  • Save clintmjohnson/e190ae163b26522ec2bcbe957545da81 to your computer and use it in GitHub Desktop.
Save clintmjohnson/e190ae163b26522ec2bcbe957545da81 to your computer and use it in GitHub Desktop.
TextBlob Sample Usage
from textblob import TextBlob
text = """TextBlob aims to provide access to common text-processing operations through a familiar interface. /
You can treat TextBlob objects as if they were Python strengs that learned how to do Natural Language Processing."""
#"This is bad " = Sentiment Sentiment(polarity=-0.6999999999999998, subjectivity=0.6666666666666666)
#"This is Good" = Sentiment Sentiment(polarity=0.7, subjectivity=0.6000000000000001)
blob = TextBlob(text)
print(blob.)
#print(blob.noun_phrases)
#print('Sentiment '+str(blob.sentiment))
#print('Translate '+str(blob.translate(to="en")))
#print('tags '+str(blob.tags))
#print('polarity '+str(blob.polarity))
#print(blob.words)
#print(blob.word_counts)
#print(blob.sentences)
#print(blob.correct())
#print(blob.find('Processing.'))
#print('noun phrases '+str(blob.noun_phrases))
#print('serialized '+str(blob.serialized))
#print('classify '+str(blob.classify()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment