Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Language sentiment analysis and neural networks... for trolls.
JavaScript
tree: 86195909ed

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
LICENSE.md
README.md
makefile
package.json

README.md

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

Something went wrong with that request. Please try again.