Troll is a tool for performing sentiment analysis (ie: "is this naughty or nice") on arbitrary blocks of text and associating it with a unique user. Using this data, combined with a rather naivé neural network and some simple training, users can be reliably classified as "trolls".
npm install troll
var troll = require('troll');
troll.analyze('This is great!', 'user123', function (err, result) {
console.log(result); // 6
});
troll.analyze('I hate this... totally stupid.', 'user456', function (err, result) {
console.log(result); // -10
});
troll.classify('user123', function (err, result) {
console.dir(result); // { user: 'user123', total: 24, sum: 10, troll: false }
});
troll.train('user456', true, function (err) {
console.log('The neural network has been told that user456 is a "troll"');
});
npm test