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

Please document the max range of each value #137

Closed
benedictchen opened this issue Apr 13, 2018 · 9 comments
Closed

Please document the max range of each value #137

benedictchen opened this issue Apr 13, 2018 · 9 comments
Assignees

Comments

@benedictchen
Copy link

It is not totally clear regarding the resulting values what the max value could be.

Please add to the documentation.

@trakout
Copy link

trakout commented Apr 24, 2018

It used to be +/- 5 (score, not the comparative score), however it appears that this is changed as I have gotten 6 or even 7 as a value.

@thisandagain
Copy link
Owner

thisandagain commented Apr 25, 2018

The range for each token as well as the comparative score is +/- 5 as per the underlying AFINN dataset, but certainly we can make it more clear in the docs. Thanks for filing!

@trakout If you are seeing cases where that isn't true can you please file a bug report with details / example strings? "Score" has always simply been the sum of all tokens, so that can have an arbitrary range, but the comparative score should always be stable between +/- 5.

@thisandagain
Copy link
Owner

Here is a thread where I explain in detail:
#107

@pdw207
Copy link

pdw207 commented Jun 20, 2018

Can this be closed or does this issue indicate an update to the README? @trakout were you able to reproduce the bug?

@trakout
Copy link

trakout commented Jun 20, 2018

@pdw207
Sure, just re-tested and was able to reproduce. I have a demo here, some setup required for the Twitter Auth. https://github.com/trakout/simple-sentiment

If you uncomment this line, you can observe sentiment scores greater than 5 or less than -5.

If you don't want to go through the setup process, I snagged some example copy from the output.
The following statement consistently outputs score: -8, comparative: -0.17391304347826086.

(the following words are from twitter and do not necessarily reflect my personal opinion or sentiment)

console.log(sentiment.analyze('So to recap-Trump wants kids held hostage. Sen. Schumer in no rush to end the kid hostage crisis. Paul Ryan in no rush to end the hostage crisis unless the Hastert rule is met. But Mitch McConnell is the only leader urging an immediate clean-bill fix.'))

@pdw207
Copy link

pdw207 commented Jun 20, 2018

@thisandagain I can take this on. Sounds like a good first issue to pick up.

@pdw207
Copy link

pdw207 commented Jun 21, 2018

As @thisandagain mentioned:

the score is the sum of all tokens, so that can have an arbitrary range

In the example you provided there are 4 negative tokens: [ 'crisis', 'no', 'crisis', 'no' ] and no positive tokens. Each token has a value between -5 and 5. crisis has a AFINN score of -3 and no AFINN score of -1, so -3 + -1 + -3 + -1 = -8.

@pdw207
Copy link

pdw207 commented Jun 21, 2018

I think this issue can be closed.

@ralyodio
Copy link

ralyodio commented Dec 25, 2020

I'm also wondering why I always get around .02 to -.02 for comparitve score. Everything I run this on is "barely" positive or "barely" negative. I'm trying to create an indicator to reflect the negativity and positivity of an article but the marker is pretty much always in the middle making it rather useless.

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

No branches or pull requests

5 participants