-
Notifications
You must be signed in to change notification settings - Fork 310
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
Support for 2-grams #158
Comments
You could possibly add something like this to your code:
|
@cristiano-belloni The issue you're encountering arises because the sentiment library's default tokenizer does not recognize multi-word expressions (like "made up" or "fucking good") out of the box. The library processes the text word by word, so multi-word phrases in the extras dictionary aren't being matched correctly. possible solution:-
sample code snippet in js, which might help you:-
hope this helps, |
Hello,
I'm trying to override the AFINN scores for 2-grams, but it doesn't seem to work:
The effect is even more accentuated when a 2-gram would flip the overall score of a phrase; here "fucking good" reinforces a positive word, but the overall score is -1:
Would it be possible and a good idea to add support for overridden 2-grams?
The text was updated successfully, but these errors were encountered: