Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 908 Bytes

README.md

File metadata and controls

22 lines (16 loc) · 908 Bytes

nrc-sentiment

NRC Word-Emotion Lexicon based sentiment analysis for Node.js

NRC Sentiment is a Node.js module that uses the NRC Word-Emotion Lexicon wordlist to perform sentiment analysis on arbitrary blocks of input text. Based on Sentiment module by Andrew Sliwinski. NRC Sentiment provides:

  • A build process that makes updating sentiment to future versions of the word list trivial

Installation

npm install git://github.com/jeremylind/nrc-sentiment

Usage

var sentiment = require('nrc-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