vader

Python 3.7 AttributeError: 'list' object has no attribute 'split'

匆匆过客 提交于 2019-12-11 04:08:38
问题 I am trying to do a sentiment analysis from a csv file where each row has a sentence. Reprex: print(your_list) [['Patience and Kindness and I know they truly love and care for animals, my dog also enjoys the events like seeing Santa and the Easter Bunny'], ['They are so sweet to my pets and try to fit them into the schedule when needed'], ['they call and check on our pet a day or 2 after visit make sure we fully understand treatment before we leave'], ['every member of the staff understands

How to edit NLTKs VADER sentiment lexicon without modifying a txt file

旧街凉风 提交于 2019-12-10 11:58:45
问题 I know you can add your own words by manually adding them to the vader_lexicon.txt file. I was wondering if there was another way that you can do it in the python code as I don't want people who use my code need to then go modify other .txt files. from nltk.sentiment.vader import SentimentIntensityAnalyzer as SIA sia = SIA() sia.lexicon This will get the dict. Was thinking something like: sia.lexicon.update{u'word': 3} 回答1: For anyone else: from nltk.sentiment.vader import

Example of NLTK's Vader Scoring Text

跟風遠走 提交于 2019-12-08 01:01:23
问题 I would like someone to correct my understanding of how VADER scores text. I've read an explanation of this process here, however I cannot match the compound score of test sentences to Vader's output when recreating the process it describes. Lets say we have the sentence: "I like using VADER, its a fun tool to use" The words VADER picks up are 'like' (+1.5 score), and 'fun' (+2.3). According to the documentation, these values are summed (so +3.8), and then normalized to a range between 0 and

Example of NLTK's Vader Scoring Text

旧时模样 提交于 2019-12-06 07:28:48
I would like someone to correct my understanding of how VADER scores text. I've read an explanation of this process here , however I cannot match the compound score of test sentences to Vader's output when recreating the process it describes. Lets say we have the sentence: "I like using VADER, its a fun tool to use" The words VADER picks up are 'like' (+1.5 score), and 'fun' (+2.3). According to the documentation, these values are summed (so +3.8), and then normalized to a range between 0 and 1 using the following function: (alpha = 15) x / x2 + alpha With our numbers, this should become: 3.8

How is the Vader 'compound' polarity score calculated in Python NLTK?

风格不统一 提交于 2019-12-03 05:49:24
问题 I'm using the Vader SentimentAnalyzer to obtain the polarity scores. I used the probability scores for positive/negative/neutral before, but I just realized the "compound" score, ranging from -1 (most neg) to 1 (most pos) would provide a single measure of polarity. I wonder how the "compound" score computed. Is that calculated from the [pos, neu, neg] vector? 回答1: The VADER algorithm outputs sentiment scores to 4 classes of sentiments https://github.com/nltk/nltk/blob/develop/nltk/sentiment