Permalink
Browse files

Updated readme

  • Loading branch information...
1 parent 2823fe9 commit 9ad3664dc93d240a9299d41d0ade5d9c856193d3 @thisandagain committed Oct 3, 2012
Showing with 9 additions and 8 deletions.
  1. +9 −8 README.md
View
@@ -3,7 +3,7 @@
[![Build Status](https://secure.travis-ci.org/thisandagain/troll.png)](http://travis-ci.org/thisandagain/troll)
-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 training, users can be classified as "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 training data, users can be indentified as "trolls".
### Installation
Troll uses [Redis](http://redis.io/) for data storage. Once Redis is up and running, you can install Troll using NPM:
@@ -15,20 +15,20 @@ npm install troll
```javascript
var troll = require('troll');
-troll.analyze('This is great!', 'user123', function (err, result) {
- console.log(result); // 6
+troll.analyze('This is totally awesome!', 'user123', function (err, result) {
+ console.log(result); // 4
});
-troll.analyze('I hate this stupid thing.', 'user456', function (err, result) {
- console.log(result); // -10
+troll.analyze('This is lame.', 'user456', function (err, result) {
+ console.log(result); // -2
});
```
### Training
Before attempting to classify a user, you'll need to train Troll. You can specify your own training data or use a basic set that is included. To load the included training set:
```javascript
troll.train(function (err, result) {
- console.dir(result); // { error: 0.005, iterations: 72 }
+ console.dir(result); // { error: 0.0049931996067587685, iterations: 802 }
});
```
@@ -40,7 +40,7 @@ troll.classify('user123', function (err, result) {
});
```
-The value returned for the `troll` key represents the probability of that user being a troll. A value close to zero means that they are most likely not a troll, while a number closer to one means that they are.
+The value returned for the `troll` key represents the probability of that user being a troll. In other words, a value of `0` would represent a particularly friendly user, while a value of `1` would be... uh, Ted Dziuba?
---
@@ -61,4 +61,5 @@ npm test
### Credits
- Sentiment analysis using [AFINN](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6010) by [thinkroth](https://github.com/thinkroth)
-- Neural network by [harthur](https://github.com/harthur)
+- Neural network by [harthur](https://github.com/harthur)
+- Training data inferred and subsequently condensed by scraping [Boing Boing's](http://boingboing.net) reader comments.

0 comments on commit 9ad3664

Please sign in to comment.