compund score in vader

Solutions on MaxInterview for compund score in vader by the best coders in the world

showing results for - "compund score in vader"
Bautista
02 Mar 2020
1def polarity_scores(self, text):
2    """
3    Return a float for sentiment strength based on the input text.
4    Positive values are positive valence, negative value are negative
5    valence.
6    """
7    sentitext = SentiText(text)
8    #text, words_and_emoticons, is_cap_diff = self.preprocess(text)
9
10    sentiments = []
11    words_and_emoticons = sentitext.words_and_emoticons
12    for item in words_and_emoticons:
13        valence = 0
14        i = words_and_emoticons.index(item)
15        if (i < len(words_and_emoticons) - 1 and item.lower() == "kind" and \
16            words_and_emoticons[i+1].lower() == "of") or \
17            item.lower() in BOOSTER_DICT:
18            sentiments.append(valence)
19            continue
20
21        sentiments = self.sentiment_valence(valence, sentitext, item, i, sentiments)
22
23    sentiments = self._but_check(words_and_emoticons, sentiments)
24