I would like to add words to the vader_lexicon.txt
to specify polarity scores to a word. What is the right way to do so?
I saw this file in AppData\Roaming\nltk_data\sentiment\vader_lexicon
. The file consists of the word, its polarity, intensity, and an array of 10 intensity scores given by "10 independent human raters". [1] However, when I edited it, nothing changed in the results of the following code:
from nltk.sentiment.vader import SentimentIntensityAnalyzer
sia = SentimentIntensityAnalyzer()
s = sia.polarity_scores("my string here")
I think that this text file is accessed by my code when I called SentimentIntensityAnalyzer's constructor. [2] Do you have any ideas on how I can edit a pre-made lexicon?
Sources: