sentiment-french
    Overview
    Reviews
    Code
    Tutorials
    Playground
    Contributors
    Issues
    Documentation
    Chat

sentiment-french

AFINN-based sentiment analysis for Node.js, in French.

1.0.2  •  Updated 3 years ago  •  Unknown License

sentiment

AFINN-based sentiment analysis for Node.js

Translated in French

Build Status

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

Usage

var sentiment = require('sentiment');

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

var r2 = sentiment('Cats are totally amazing!');
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');

var result = sentiment('Cats are totally amazing!', {
    'cats': 5,
    'amazing': 2  
});
console.dir(result);    // Score: 7, Comparative: 1.75

Benchmarks

The primary motivation for designing sentiment was performance. As such, it includes a benchmark script within the test directory that compares it against the Sentimental module which provides a nearly equivalent interface and approach. Based on these benchmarks, running on an older MacBook Air with Node 0.10.26, sentiment is more than twice as fast as alternative implementations:

sentiment (Latest) x 244,901 ops/sec ±0.49% (100 runs sampled)
Sentimental (1.0.1) x 94,135 ops/sec ±0.50% (100 runs sampled)

To run the benchmarks yourself, simply:

make benchmark

Testing

npm test

Popularity

Weekly Downloads
3
Stars
11

Maintenance

Development

Last ver 4 years ago
Created 4 years ago
Last commit 4 years ago
4 minutes between commits

Technology

Node version: 0.10.21
0 unpacked

Compliance

License Unknown
Not OSI Approved
0 vulnerabilities

Contributors

5 contributors
Andrew Sliwinski
36 commits
Works at MIT Media Lab
John Thillaye
Maintainer, 2 commits
Josh
1 commits
Works at officeluv & NarroApp
MicahFulton
1 commits
Works at SEVII
Luis Montes
1 commits
Works at Iced Dev

Tags

sentiment
analysis
nlp
sentiment analysis
Ready for the next level?
Join Openbase's founding team to help us build the ultimate open-source app store, work with the latest technologies, and enjoy great culture, impact and autonomy
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookLinkedIn
© 2020 Devstore, Inc.