Skip to content

Commit

Permalink
Rough-in the readme, license and package description
Browse files Browse the repository at this point in the history
  • Loading branch information
thisandagain committed Oct 2, 2012
1 parent d0cb44d commit 8619590
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 9 deletions.
14 changes: 10 additions & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 1,13 @@
Copyright (c) 2012 Andrew Sliwinski.
Copyright 2012 DIY, Co.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
http://www.apache.org/licenses/LICENSE-2.0

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
45 changes: 41 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 1,54 @@
## troll
#### Language sentiment analysis... for trolls.
#### 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
```bash
npm install troll
```

### Basic Use
### String Analysis
```javascript
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
```javascript
troll.classify('user123', function (err, result) {
console.dir(result); // { user: 'user123', total: 24, sum: 10, troll: false }
});
```

### Training
```javascript
var troll = require('troll');
troll.train('user456', true, function (err) {
console.log('The neural network has been told that user456 is a "troll"');
});
```

---

### Redis Connection Options
```javascript

```

---

### Testing
```bash
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)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 1,7 @@
{
"author": "Andrew Sliwinski <[email protected]> (http://andrewsliwinski.com)",
"name": "troll",
"description": "Language sentiment analysis... for trolls.",
"description": "Language sentiment analysis and neural networks... for trolls.",
"version": "0.0.1",
"homepage": "https://github.com/thisandagain/troll",
"repository": {
Expand Down

0 comments on commit 8619590

Please sign in to comment.