I am using NLTK for python and I am trying to update the scores for a set of words. Whilst it appears that the scores are updating, they don't appear to update in the way that I am specifying. I'm wondering if anyone knows how this process works?
I have attached a minimum working example below, showing the scores before and after the update
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
SIA = SentimentIntensityAnalyzer()
print(SIA.polarity_scores('moon'))
SIA.lexicon.update({'moon': 5})
print(SIA.polarity_scores('moon'))
The scores from the before and after can be seen below
{'neg': 0.0, 'neu': 1.0, 'pos': 0.0, 'compound': 0.0}
{'neg': 0.0, 'neu': 0.0, 'pos': 1.0, 'compound': 0.7906}