IBM Expands Watson Cognitive APIs

by Benjamin Young on Mar 18, 2016 |

IBM has recently expanded their collection of Watson Cognitive APIs to include beta updates to the Emotion and Tone Analysis APIs.

IBM Watson Emotion Analysis was added to the existing suite of AlchemyLanguage APIs. This suite of APIs joined the Watson services list as part of IBM's acquisition of AlchemyAPI roughly a year ago. The Emotion Analysis API currently processes text and attempts to rank the content against five emotions: joy, fear, sadness, disgust, and anger.

The example in the announcement blog post analyzed the text: "the day I was told that I had been accepted as a student of economics." The output emotional rankings for that text were:

  • anger: 0.045
  • disgust: 0.023
  • joy: 0.93
  • fear: 0.035
  • sadness: 0.07

From those values, developers can make inferences about the emotion conveyed in the overall text.

The API supports processing text and HTML content sent directly to the endpoint via HTTP or by passing in a URL of publicly available content on the Web. Output from the API is available in both XML and JSON formats. Pricing is per request with 1,000 API events for free per IBM Bluemix Organization. Paid pricing starts at $0.007 USD per event up to 250,000 events.

IBM Watson Tone Analyzer is similar, but adds language and social tone to the analysis.

Language tone is broken into three categories: analytical, confident, and tentative. In the case of the example text above, the analytical score was 0.39 with confidence and tentativeness being 0.

The social-tone analysis is broken into five different social tones: openness, conscientiousness, extraversion, agreeableness, and emotional range (or neuroticism) which are known as the "Big Five" personality traits. Analysis of the example text returned these metrics for those five social tones:

  • openness: 0.134
  • conscientiousness: 0.409
  • extraversion: 0.474
  • agreeableness: 0.736
  • emotional range: 0.784

This API uses a similar HTTP API using simple GET and POST requests with a single response. The documentation includes examples for curl, Node, Java, and Python. Tone Analyzer is free for the beta period via IBM Bluemix. Here's the Node example usage for the sample text from earlier:

var watson = require('watson-developer-cloud');

var tone_analyzer = watson.tone_analyzer({
  username: '{username}',
  password: '{password}',
  version: 'v3-beta',
  version_date: '2016-02-11'

tone_analyzer.tone({ text: 'the day I was told that I had been accepted as a student of economics.' },
  function(err, tone) {
    if (err)
      console.log(JSON.stringify(tone, null, 2));

IBM has made an Application Starter Kit available which uses both AlchemyLanguage and Tone Analyzer alongside the AlchemyData News API. Currently, these APIs only support English language texts.

This sample application demonstrates how to use web and social media and natural language processing to understand important topics and how people feel about those topics.

Developers interested in exploring these APIs via hands-on experience should consider the online Watson Developer Challenge (running now through April 15) as well as the in-person World of Watson Hackathon May 21-22, 2016 at Pier 36 in NYC.

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

I don't trust IBM by Ilya Geller

I doubt IBM tells everything. Why? They did it only currently, after 75 years. Why? What happened?

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss
General Feedback
Marketing and all content copyright © 2006-2016 C4Media Inc. hosted at Contegix, the best ISP we've ever worked with.
Privacy policy

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.