cjhutto / vaderSentiment

VADER Sentiment Analysis. VADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based sentiment analysis tool that is specifically attuned to sentiments expressed in social media, and works well on texts from other domains.
MIT License
4.43k stars 1k forks source link

Unable to add own words to vader_lexicon.txt #58

Closed Rishav09 closed 6 years ago

Rishav09 commented 6 years ago

I want to add own words to vader_lexicon.txt but it is throwing an error (word, measure) = line.strip().split('\t')[0:2] ValueError: not enough values to unpack (expected 2, got 1)

I modified the make_lex_dict method by adding the if statement as: def make_lex_dict(self): lex_dict = {} for line in self.lexicon_full_filepath.split('\n'): if "," in line: (word, measure) = line.strip().split('\t')[0:2] lex_dict[word] = float(measure) return lex_dict`

It resolved the error but the score is not deflected back on running the program and its giving the neutral score ,even after me assigning other values to the words