sentiment140
This is a NodeJS Client Library for the sentiment140 Natural Language Processing Service API
Last updated 5 years ago by pmoelgaard .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install sentiment140 
SYNC missed versions from official npm registry.

Sentiment Analysis 140

JavaScript wrapper for the Sentiment140 Natural Language Processing Service.


Installation

npm install sentiment140 [--save]

Usage

Setup

var Sentiment140 = require('sentiment140');
var sentiment140 = new Sentiment140({
	auth: '[INSERT YOUR EMAIL HERE]'
});

Simple Analysis

Takes a simple string.

Request
var dataSimple = {
	"data": {
    	"text": "I am a Teapot and a Submarine"
	}
}
sentiment140.sentiment(dataSimple, function(error, result) {
	console.log(JSON.stringify(result));
});
Response
[Missing]

Bulk Detection

Takes an array of simple strings.

Request
var dataBulk = {
	"data": [
    	{"text": "I love Titanic.", "id": 1 },
    	{"text": "I hate Titanic.", "id": 2 },
    	{"text": "I like Titanic.", "id": 3 }
	]
}
sentiment140.sentiment(dataBulk, function(error, result) {
	console.log(JSON.stringify(result));
});
Response
[Missing]

Promises & Callbacks

The sentiment140 library now supports both traditional callback return functions as well as Promises. Sentiment140 uses the bluebird library for the promise implementation.


Author

Peter Andreas Moelgaard (GitHub, Twitter)

License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Current Tags

  • 1.2.0                                ...           latest (5 years ago)

7 Versions

  • 1.2.0                                ...           5 years ago
  • 1.1.7                                ...           5 years ago
  • 1.1.6                                ...           7 years ago
  • 1.1.5                                ...           7 years ago
  • 1.1.4                                ...           7 years ago
  • 1.1.3                                ...           7 years ago
  • 1.1.2                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2021 © npmmirror.com |