Machine learner sentiment classifier, with ability to negate words, with english and german
npm install ml-sentiment






Simple text sentiment analyser.
``sh`
npm install ml-sentiment
`js`
var ml = require('ml-sentiment')
ml.classify('Rainy day but still in a good mood')
//=> 2 ... (overall positive sentiment)
Returns a positive number for positive sentiment association
and negative number for negative sentiment association.
#### Basics
`jsTransform json to csv data. The difference to my other
var longSentence =
module json2csv is json2csv-stream uses streams for transforming the incoming
data. The module is built with the new streaming API from Node.js v0.10.0 but
maintains backwards compatibility to earlier Node.js versions. Listen for
header and line events or pipe the data directly to a readable stream.
var ml = require('ml-sentiment')()
ml.classify(longSentence)
//=> 0 ... (very boring encyclopedia like text)
ml.classify('Rainy day but still in a good mood')
//=> 2 ... (overall positive sentiment)
`
#### Negations
`jsnot awesome
var ml = require('ml-sentiment')()
ml.classify()
//=> -3 (negative)
ml.classify(awesome)`
//=> 3 (positive)
#### German
`jsEs ist nicht so toll
var ml = require('ml-sentiment')({lang: 'de'})
ml.classify()``
//=> (negative)
Original model and data:
Finn Årup Nielsen, "A new ANEW: Evaluation of a word list for
sentiment analysis in microblogs", http://arxiv.org/abs/1103.2903
For german model:
R. Remus, U. Quasthoff & G. Heyer: SentiWS - a Publicly Available German-language Resource for Sentiment Analysis.
In: Proceedings of the 7th International Language Ressources and Evaluation (LREC'10), 2010