from textblob import TextBlob
# Get the sentiment of a phrase
sentiment = TextBlob(“I love my life”).sentiment
print(sentiment)
Finished! You will now have an object that contains the data relating to positivity/negativity and how subjective/objective your sentences are.
In the complete code on codelab you can also test a practical approach related to the use of even basic techniques of NLP.
Natural Language Processing
Made with Love by Antonio Scapellato