Skip to content

Language sentiment analysis and neural networks... for trolls.

License

Notifications You must be signed in to change notification settings

thisandagain/troll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

troll

Language sentiment analysis and neural networks... for trolls.

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".

Installation

npm install troll

String Analysis

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 
});

User Classification

troll.classify('user123', function (err, result) {
    console.dir(result);    // { user: 'user123', total: 24, sum: 10, troll: false }
});

Training

troll.train('user456', true, function (err) {
    console.log('The neural network has been told that user456 is a "troll"'); 
});

Redis Connection Options


Testing

npm test

Credits