You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

sentiment-multi-language

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sentiment-multi-language

AFINN-based sentiment analysis for Node.js PS: modified by Felipe Paiva

1.0.4
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

sentiment (multi language)

AFINN-based sentiment analysis for Node.js (multi language)

Forked from (https://github.com/thisandagain/sentiment) and modified by Felipe Paiva

Suported Languages

  • Brazilian Portuguese (pt-BR)
  • English (en-US)
  • Emoticons (All Languages)

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-multi-language

Usage

var sentiment = require('sentiment-multi-language');

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

var r1 = sentiment('Cats are stupid!', 'en-US');
console.dir(r1);       // Score: -2, Comparative: -0.666

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-multi-language');

var result = sentiment('Cats are stupid!', 'en-US', {
    'cats': 5,
    'stupid': -7  
});
console.dir(result);    // Score: -2, Comparative: -0.666

Keywords

sentiment

FAQs

Package last updated on 12 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts