Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dictionary contains phrases like "fed up" that will never hit because of how the sentence is tokenized #124

Open
kirsten-stallings opened this issue Feb 4, 2021 · 1 comment

Comments

@kirsten-stallings
Copy link

The dictionary contains phrases like "fed up" but since the code checks if words are in the dictionary on a word by word basis, these phrases never hit:

> from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
>>> analyzer=SentimentIntensityAnalyzer()
>>> analyzer.polarity_scores("I am fed up")
{'neg': 0.0, 'neu': 1.0, 'pos': 0.0, 'compound': 0.0}
>>>
@ViennaMike
Copy link

ViennaMike commented Nov 17, 2022

If I understand the code correctly, "fed up" (or any other multi-word phrases) should be removed from the lexicon.txt file and instead be added to the SENTIMENT_LADEN_IDIOMS, but the actual code for handling this seems to be a placeholder for a future addition.

I found a work-around for handling bigrams (2-word phrases) on Stack Overflow: https://stackoverflow.com/questions/67798527/nltk-vader-sentimentintensityanalyzer-bigram

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants