🎩 A Node.js client library for HP Haven OnDemand Sentiment Analysis module
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Added .gitignore Oct 14, 2015
README.md Added depreciation message in readme 😢Ref #2 Feb 18, 2019
gulpfile.js Removed tests, since there's not a lot to test Oct 14, 2015
index.coffee Implemented the option to send a string query rather than full JSON o… Oct 14, 2015
index.js
package.json V 0.1.0 Oct 14, 2015

README.md

🚨Note: The original Haven OnDemand service is not currently operational. This package will NOT work🚨

While Daven OnDemand is down, this package will no longer work. If MicroFocus (the buyer of Haven OnDemand) provides support for the original Haven OnDemand again, I will update this module accordingly, to get it working again.

In the meantime, IBM Watson, Microsoft Azure and Google Cloud offers similar text analysis products, and are free to use for small / personal projects.

Alternativley if it's just sentiment analysis your after, I have written my own stand-alone, AFINN-111 based package, here: sentiment-analysis. Hope that helps!


haven-sentiment-analysis

Node.js client for HP Haven OnDemand Sentiment Analysis

Dependency Status devDependency Status Code Climate

Install

npm install git://github.com/Lissy93/haven-sentiment-analysis.git

Usage

var sentimentAnalysis =  require('haven-sentiment-analysis');
var apiKey = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX';
var string = 'dinosaurs are awesome and I love ice cream';

sentimentAnalysis(string, apiKey, function(results){
    console.log(results); // Do some awesome stuff with sentiment data!
});

There is also the option of passing a JSON object rather than a String as the first paramater, in order to specify additional options. See the Haven OnDemand documentation for full list of paramater options.

Example Output

{
  "positive": [
    {
      "sentiment": "awesome",
      "topic": "dinosaurs",
      "score": 0.8952832264587852,
      "original_text": "dinosaurs are awesome",
      "original_length": 21,
      "normalized_text": "dinosaurs are awesome",
      "normalized_length": 21
    },
    {
      "sentiment": "love",
      "topic": "icecream",
      "score": 0.8053406931054015,
      "original_text": "I love icecream",
      "original_length": 15,
      "normalized_text": "I love icecream",
      "normalized_length": 15
    }
  ],
  "negative": [],
  "aggregate": {
    "sentiment": "positive",
    "score": 0.8503119597820934
  }
}

Obtaining an API Key

Head over to HP Haven OnDemand, log in or sign up and then navigate to the 'My Keys' page. API Keys are free for under 50,000 requests monthly. (at the time of writing this)

Development

See gulpfile.js for automated build tasks

License

MIT © Alicia Sykes