-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rough-in the readme, license and package description
- Loading branch information
1 parent
d0cb44d
commit 8619590
Showing
3 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": { | ||
|