The Unconventional Guide to Call Center Performance Analysis using AI – Part 2

Now, we continue what we started in (The Unconventional Guide to Call Center Performance Analysis using AI – Part 1), and implement a really cool step, which is sentiment analysis.

Sentiment analysis

Sentiment analysis is among the most exciting problems in the field on NLP (Natural Language Processing). It consists of identification of a text attitude towards a topic, positively or negatively, and returning a score between some maximum negative and maximum positive (e.g., 0 to 1 or -1 to 1). The sentiment analysis API depends on detecting proper and common nouns. Typically, the lowest value refers to a very negative attitude and highest refers to a very positive attitude. Usually, a particular threshold is set to identify positive and negative sentiment (e.g., 70% and 30% from the range respectively).

Sentiment analysis produces a higher quality result when you give it smaller chunks of text to work on. This is opposite from key phrase extraction, which performs better on larger blocks of text. To get the best results from both operations, consider restructuring the inputs accordingly.

As expected, all vendors have their version of sentiment analysis. Microsoft has sentiment analysis with Azure Text Analytics suite, Google in Cloud Natural Language API, Amazon in Amazon Comprehend and IBM has Watson tone analyzer.

On the surface, all APIs might seem similar, and it is just a matter of pick and choose. As a matter, if fact, this is incorrect, there are crucial differences that can significantly impact your analysis results. Let us have a quick discussion.

Azure Text Analytics: I would consider Microsoft offering is the simplest in terms of capabilities. The API only returns” score” parameter which ranges from zero (very negative) to one (very positive). Therefore, it does not provide any context. A common problem with such simplistic approach is that it confuses a neutral statement (score around 0.5) with a statement that contains both very positive and negative sentiments which will cancel out and generate a sentiment with a score around 0.5 too. A sample response is shown below.

Google in Cloud Natural Language API: Google fixes the confusion problem Microsoft API has by introducing the magnitude parameter. Magnitude parameter is an unnormalized parameter that lies between zero and infinity and indicates the strength of the expression (positive or negative), typically longer text blocks will result in greater magnitude. A neutral sentiment will result in an average score, and very low magnitude and a mixed sentiment will result in an average score and a high magnitude. A sample response is shown below.

Amazon Comprehend sentiment service: Amazon follows a more explicit approach to differentiate sentiments, by breaking down each sentiment type with its corresponding confidence level. A sample response is shown below.

IBM Watson Tone Analyzer: I would consider this is the most interesting service. The service comes in two flavors: i) General purpose and ii) Customer engagement. Watson tone analyzer does not return negative or positive sentiments, but rather a description of the tone. I would consider Watson tone analyzer is the most suitable option to understand customer emotions.

General purpose endpoint informs whether the tone is anger, fear, joy, sadness, analytical, confident or tentative. While the customer engagement endpoint informs if the tone is excited, frustrated, impolite, polite, sad, satisfied or sympathetic. Sample responses are shown below.

Some factors to consider when choosing sentiment analysis API

Before opting to a particular API, I would recommend asking the following questions:

  • What content limit is imposed by the API (e.g. number of characters/bytes)
  • What languages are supported?
  • Does it support batch operations?
  • Does it support custom learning (e.g. providing some domain specific terms)?
  • Does it support language detection?
  • Does it support asynchrounous operations?

Finally, my original plan was to create a demo using C# code, however, I provide a short youtube video soon showing how to use the APIs with API console so that we learn something new : – )