For the VADER SentimentIntensityAnalyzer within Python, is there a way to add a bigram rule? I tried updating the lexicon with a two word input, but it did not change the polarity score. Thanks in advance!
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
analyser = SentimentIntensityAnalyzer()
#returns a compound score of -0.296
print(analyser.polarity_scores('no issues'))
analyser.lexicon['no issues'] = 0.0
#still returns a compound score of -0.296
print(analyser.polarity_scores('no issues'))
There is no straightforward way to add bigram to the vader lexicon. This is because vader considers individual tokens for sentiment analysis. However, one can do this using following steps:
Following code accomplishes the above:
The output :
Notice in the output, how two words "no" and "issues" have been added together to form bigram "noissues".