Code Monkey home page Code Monkey logo

Comments (4)

thisandagain avatar thisandagain commented on July 24, 2024

@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.

sseetal avatar sseetal commented on July 24, 2024

Thanks for getting back to me.

  1. We're using nvm everywhere. node 4.1.1 locally (MAC), v6.9.4 on Server (Ubuntu)
  2. 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)
  3. 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.

sseetal avatar sseetal commented on July 24, 2024

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.

thisandagain avatar thisandagain commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.