Understand Customer Feeling from Case With IBM Watson

In this post, we are going to see how to use IBM Watson tone analyzer services understand the customer emotional, social, and language tones from the case descriptions. You can use IBM Waston services in many ways like understand the customer tone from Analyzing text marketing campaigns, Understanding the lead interested level, understand customer happiness from the case is few use cases. Let’s assume the case is coming from the web to lead with case subject and Description about the case . This post we are going to Predict whether they are happy, sad, confident, and more from the description an the subject.

What is Watson Tone Analyzer?

The IBM Watson Tone Analyzer service uses linguistic analysis to detect emotional, social, and language tones in written text. The service can analyze tone at both the document and sentence levels. You can use the service to understand how your written communications are perceived and then to improve the tone of your communications. Businesses can use the service to learn the tone of their customers’ communications and to respond to each customer appropriately or to understand and improve their customer conversations in general.You submit JSON, plain text, or HTML input that contains your written content to the service. The service returns JSON results that report the tone of your input. You can use these results to improve the perception and effectiveness of your communications, ensuring that your writing conveys the tone and style that you want for your intended audience. The following diagram shows the basic flow of calls to the service.

Submit content to the Tone Analyzer service and use the results to improve your communications.

1. Create Waston Service

To get started, one can just create an IBM login at https://console.ng.bluemix.net and create a service called “Tone Analyzer” as shown below.

Select the Service click on create a service to receive your credentials which are required to make an API call from the salesforce.


2. Create Named Credential in Salesforce

Create a named credential in Salesforce with the Tone Analyzer service credentials which you got them from the first step and you can use those in call out to IBM Watson services.

3. Simple Visualforce page.

That’s all. Here is the below Sample visualforce page that displays the customer emotions based on the case subject and description. The page shows the complete custom tone in different areas of the Emotions and Language styles and Social Tendencies.

4.Code Walkthrough

Here is the below piece of code that prepares the Json file to send the HTTP request to Watson services.

Below piece of code shows how to make the Http Call to IBM Watson tone services. We are using the Named Credentials with call out.


Below Piece of code is for the JSON parsing.

Here is the visual force page the show the result.

Here is the complete code



If you’d like help identifying how your customers are feeling, IBM Watson tone analyzer will help you to understand.