Created
June 6, 2018 09:24
-
-
Save siakon89/d6e9d07ae53492641d4fa9557080fdf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import the TextBlob package | |
from textblob import TextBlob | |
# A negative text | |
negative_blob = TextBlob("This is an awful day!") | |
# Extract sentiment from blob | |
print(negative_blob.sentiment) | |
# Print: Sentiment(polarity=-1.0, subjectivity=1.0) | |
# A neutral text | |
neutral_blob = TextBlob("My day is neutral") | |
# Extract sentiment from blob | |
print(neutral_blob.sentiment) | |
# Print: Sentiment(polarity=0.0, subjectivity=0.0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment