JSPM

sentiment-ptbr

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14
  • Score
    100M100P100Q47398F

AFINN-based sentiment analysis for Node.js PS: modified by Aristeu Roriz for test use only

Package Exports

  • sentiment-ptbr

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sentiment-ptbr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

sentiment (pt-BR)

AFINN-based sentiment analysis for Node.js (pt-BR)

Forked from (https://github.com/thisandagain/sentiment) and modified by Aristeu Roriz for test use only

Sentiment is a Node.js module that uses the AFINN-111 wordlist to perform sentiment analysis on arbitrary blocks of input text. Sentiment provides serveral things:

  • Performance (see benchmarks below)
  • The ability to append and overwrite word / value pairs from the AFINN wordlist
  • A build process that makes updating sentiment to future versions of the AFINN word list trivial

Installation

npm install sentiment-ptbr

Usage

var sentiment = require('sentiment-ptbr');

var r1 = sentiment('Gatos são estúpidos!');
console.dir(r1);        // Score: -2, Comparative: -0.666

var r2 = sentiment('Gatos são incríveis!');
console.dir(r2);        // Score: 4, Comparative: 1

Adding / overwriting words

You can append and/or overwrite values from AFINN by simply injecting key/value pairs into a sentiment method call:

var sentiment = require('sentiment-ptbr');

var result = sentiment('Gatos são incríveis!', {
    'gatos': 5,
    'incríveis': 2  
});
console.dir(result);    // Score: 7, Comparative: 1.75