How to update emoji in vader lexicon?

Viewed 302

I want to update the chart up and chart down emojis sentiment values in the vader lexicon. Seeing this post (VaderSentiment: unable to update emoji sentiment score) I have tried to replicate it but with no success:

new_words = {
    "chart decreasing" : -1,
    "" : -1
}
analyzer.lexicon.update(new_words)

analyzer.polarity_scores("")

Result: {'neg': 0.0, 'neu': 1.0, 'pos': 0.0, 'compound': 0.0}

It should show neg: 1.0, as I have just updated the lexicon.

Any ideas how to update the values?

1 Answers
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer

new_words = {
    'decreasing': -4.0,
}

sia = SentimentIntensityAnalyzer()
sia.lexicon.update(new_words)
sia.polarity_scores('')
Related