PubNub Integration

IBM Watson: Sentiment and Context Analysis

In-app chat

In-app chat

Data Streaming & Dashboards

Data Streaming & Dashboards

Last Updated:

2016/08/01

Author:

PubNub

Get your API Keys

Analyze text to understand and act on sentiment, context, emotion, entity, and language

Natural Language Understanding from IBM Watson provides a number of APIs for text analysis through natural language processing. The APIs are able to analyze text, and understand a wide variety of characteristics, including sentiment, entity, emotion, keyword, concept tagging, language, and taxonomy.

The IBM Watson Natural Language Understanding block lets you analyze and run functions on your data streams, with all computation taking place in the network. For example, analyze chat messages coming through a customer support app, gauge emotion or detect language, and filter those messages to a specific representative. Your data streams just got way smarter.

Walkthrough

The sentiment and context analysis block uses the IBM Watson Natural Language Understanding to analyze text and execute functions based on the sentiment or emotion of that message. This is done in an after-publish event handler. The sentiment analysis for each message is saved in the PubNub distributed data store. The session sentiment is calculated as an average and is published on an output sentiment channel.

Input

Publish this data on the input channel.

{
    "text"       : "Feeling happy",
    "session_id" : "episode1"
}

Output

The sentiment average is added to the message.

{ 
    "session_id": "episode1",
    "session_sentiment":  {
        "overall": 3.1678750000000004,
        "positive": { 
            "count": 13, 
            "avg": 0.6078368461538461 
        },
        "negative": { 
            "count": 8, 
            "avg": -0.5917505 
        },
        "neutral": { 
            "count": 2, 
            "avg": null 
        }
    }
}

Feedback & Support

Need help? Contact PubNub Support.

More integrations for you

IBM Watson Assistant
    IBM Watson Assistant

    Add a natural language interface or chatbot to automate interactions with...

    Learn more
    IBM Watson: Language Translator
      IBM Watson: Language Translator

      Translate and publish text in realtime for 11 different languages

      Learn more
      Tisane Labs NLP - Realtime Text Analysis in 27 Languages
        Tisane Labs NLP - Realtime Text Analysis in 27 Languages

        Detect abusive content, sentiment analysis, and tagging/categorization in...

        Learn more

        Talk to an expert

        Contact Sales