Comments (4)
@sseetal Can you provide a little more info?
- What versions of node are you running on the server and your computer?
- What are the input strings that are producing these results?
- Can you share the output from both instances? It is difficult to understand what you are expecting.
from sentiment.
Thanks for getting back to me.
- We're using nvm everywhere. node 4.1.1 locally (MAC), v6.9.4 on Server (Ubuntu)
- The input streams are in the results I posted above (happy, sad, ok) to try and get the three desired results (positive, negative and neutral results)
- I tried getting the local results (the server results are above). I can now further understand the problem. It's because they are one word.
INPUT sentiment
For input "happy" (both locally and on server)
{ score: 3,
comparative: 3,
tokens: [ 'happy' ],
words: [ 'happy' ],
positive: [ 'happy' ],
negative: [] }
For input "happy cat"
{ score: 3,
comparative: 1.5,
tokens: [ 'happy', 'cat' ],
words: [ 'happy' ],
positive: [ 'happy' ],
negative: [] }
For Input "I am happy today"
{ score: 3,
comparative: 0.75,
tokens: [ 'i', 'am', 'happy', 'today' ],
words: [ 'happy' ],
positive: [ 'happy' ],
negative: [] }
It was hard to find in the docs but all i really need is the range of values (Min and Max) for score and comparative. I thought comparative was between -1 and 1, but now I can't tell.
from sentiment.
Just to add more context. We're using this to analyze comments left by people in a survey. The whole point is to have a score and an overall score. Ideally a score out of 100. But can't seem to figure out how to calculate a comparable score.
from sentiment.
This issue includes a thread that covers some of the areas you are asking about including how "comparative score" works and how to scale / offset it.
TL;DR: Tokens are scored between -5 (highly negative) and 5 (highly positive) with 0 being "neutral". Comparative scores are simply SUM(tokens) / number of tokens. Details can be found in the AFINN whitepaper:
http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6010
Sorry that the docs don't make this more clear. I'll file an issue now to make sure I don't forget to improve them. 😄
from sentiment.
Related Issues (20)
- Bundle for browser usage? HOT 4
- Support smileys HOT 1
- Replace makefile with npm scripts
- Update code formatting HOT 2
- Please document the max range of each value HOT 9
- Support overwriting emoji HOT 2
- Code Coverage Badge HOT 1
- Provide calculation used to calculate score HOT 2
- Feature Request: DefinitelyTyped typescript definitions HOT 2
- Can this run in the browser? HOT 2
- inflected words and adjectives in other languages.
- want compiled score for array of phrases
- Support for 2-grams HOT 2
- Improvements inspired by VADER
- Escape question marks along with other forms of punctuations HOT 1
- All the messages are getting logged HOT 3
- Inverse words if not HOT 6
- Can someone recommend any learning resources? HOT 2
- is the comparitive number between -1 and 1? HOT 2
- Why didn't you use the full range of emotions in the original NRC dictionary?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentiment.