.. _textblob_polarity: Textblob Polarity ================== High-Level Intuition ********************* Measures the polarity i.e. how positive or negative a message is Citation ********* `Cao, et al. (2020) `_ Implementation Basics ********************** To calculate polarity, we use the TextBlob Library in Python. This library is implemented using the Naive Bayes Algorithm, `Textblob `_ which is a "Bag of Words"-based classifier. Implementation Notes/Caveats ***************************** This function uses a "Bag of Words"-based classifier, which is a naive way of measuring polarity. For example, in the sentence "Everything in this restaurant was anything but lovely, amazing, wonderful, great!", the sentence actually has a negative meaning as it means that nothing in the restaurant was good. However, the algorithm will classify it as a positive sentence because it simply counts the number of positive and negative words (4 positive words in this case make the sentence positive for the algorithm). Interpreting the Feature ************************* Scores are a continuous variable, ranging from -1 (extremely negative) to 1 (extremely positive) Related Features ***************** This feature is one of several that measure sentiment. Other sentiment-related features include :ref:`positivity_bert`; Negative_Emotion and Positive_Emotion, which are attributes of :ref:`politeness_receptiveness_markers`; and LIWC (a relevant column name being positive_affect_lexical_per_100).