Vader.py of NLTK is a bit different from the "updated" version of Vader itself (https://github.com/cjhutto/vaderSentiment/blob/master/vaderSentiment/vaderSentiment.py). I have been trying to add the pieces of code that are missing, but I'm having issues with this specific function:
def __init__(self, lexicon_file="vader_lexicon.zip/vader_lexicon/vader_lexicon.txt", emoji_lexicon="emoji_utf8_lexicon.txt"):
_this_module_file_path_ = os.path.abspath(getsourcefile(lambda: 0))
lexicon_full_filepath = os.path.join(os.path.dirname(_this_module_file_path_), lexicon_file)
with codecs.open(lexicon_full_filepath, encoding='utf-8') as f:
self.lexicon_full_filepath = f.read()
self.lexicon = self.make_lex_dict()
emoji_full_filepath = os.path.join(os.path.dirname(_this_module_file_path_), emoji_lexicon)
with codecs.open(emoji_full_filepath, encoding='utf-8') as f:
self.emoji_full_filepath = f.read()
self.emojis = self.make_emoji_dict()
The error says FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\annas\\PycharmProjects\\fine-grained-sentiment-master\\venv\\lib\\site-packages\\nltk\\sentiment\\vader_lexicon.zip/vader_lexicon/vader_lexicon.txt'
, but I checked and it's there. What am I doing wrong?