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

is the comparitive number between -1 and 1? #177

Open
ralyodio opened this issue Dec 25, 2020 · 2 comments
Open

is the comparitive number between -1 and 1? #177

ralyodio opened this issue Dec 25, 2020 · 2 comments

Comments

@ralyodio
Copy link

or is it -5 and 5?

I always get less than 1 or -1.

@shamoons
Copy link

shamoons commented Jun 2, 2021

Same question.

@kacesensitive
Copy link

@ralyodio @shamoons i know this is old but i had the same question so i just dug around, the calculation is tokens.length > 0 ? score / tokens.length : 0,
so in the example
{ score: 1, comparative: 0.1111111111111111, calculation: [ { allergic: -2 }, { love: 3 } ], tokens: [ 'i', 'love', 'cats', 'but', 'i', 'am', 'allergic', 'to', 'them' ], words: [ 'allergic', 'love' ], positive: [ 'love' ], negative: [ 'allergic' ] }

since our net score is 1 and we have 9 tokens the comparative score is 1/9 (0.11111..)

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

3 participants