Aravind Rajendran
Aravind Rajendran

Reputation: 1

Sentiment Analysis - polarity

If Polarity is 0.0 in TextBlob, whether the sentence is purely negative or it means no output.

wiki = TextBlob ("Python is a high-level, general-purpose programming language.")

wiki.sentiment

output: Sentiment(polarity=0.0, subjectivity=0.0)

Please explain what the output is actually telling to us?

Upvotes: 0

Views: 1657

Answers (1)

Ankur Sinha
Ankur Sinha

Reputation: 6649

Short answer: Neutral (neither positive nor negative)


Explanation:

If you go through the docs here: https://textblob.readthedocs.io/en/dev/quickstart.html#sentiment-analysis

And see the example here:

testimonial = TextBlob("Textblob is amazingly simple to use. What great fun!")
testimonial.sentiment

Output:

Sentiment(polarity=0.39166666666666666, subjectivity=0.4357142857142857)

You can see that the range of polarity varies between -1 and 1 where the positive end denotes positive tone, and negative end denotes negative tone in the sentence. Hence, a polarity of 0 would be neutral. It also completely makes sense in your case as one cannot say if your sentence is positive or negative.

Similarly, check out another example from: https://planspace.org/20150607-textblob_sentiment/

TextBlob("not great").sentiment

Output:

Sentiment(polarity=-0.4, subjectivity=0.75)

Upvotes: 1

Related Questions