Understand the sentiment of your customers’ tickets with Azure Cognitive Services

Wouldn’t it be great if service Cases could be automatically categorised as Happy or Unhappy, so that the unhappy ones could be routed to a high priority queue for quick processing?

Well, Azure Cognitive Services are a group of cloud intelligence services that help you to do just that.  There are a whole bunch of cool services available (from product catalogue recommendations to speech intent analysis), and we’ll use the Sentiment Analysis capability within the Text Analytics API to create a happiness rating.

And by using an Azure Logic App to do the actual processing work, we’ll have zero coding to do.  Yes, no code = happy sentiment.

Outcome

So this is what we want to achieve:

  1. When a service Case is created…

casewithdescription

  1. An Azure Logic App will be triggered that will:
    1. Read the Description field
    2. Generate a sentiment score from 0 to 1 (where 0 is very unhappy, and 1 is very happy) based on the contents of the Description
    3. Update the Case Sentiment Score field in the Case record

sentimentscore

  1. From here you can then trigger any CRM process you like, queue routing, workflow notification etc.

Step 1 – create the sentiment score field

Create a new field in Dynamics 365 and call it Case Sentiment Score.  Add the field to your Case form.

Step 2 – create the logic app

(This step assumes you have an Azure Subscription, if not you can sign up for a free trial here).

In Azure, create a blank Logic App:

  1. Click New > Web + Mobile > Logic App
  2. Give it a Name, Subscription, Resource Group and Location
  3. Click Create

createlogicapp

  1. Open your newly created Logic App and select the Blank Logic App template

blanklogicapp

Step 3 – add the three logic app steps

  1. In the Logic Apps Designer, enter “Dyn” into the search box
  2. Select Dynamics 365 – When a record is createdla_step1
  1. Sign in to your Dynamics 365 org to create the connection between Azure and Dynamics 365
  2. Select the Organization Name for your CRM instance
  3. For Entity Name, select Cases
  4. For Frequency, select 1 second.sentiment1
  5. Click New Step
  6. Click Add an actionla_step3
  7. Enter “Cog” into the search box
  8. Select Cognitive Service Text Analytics – Detect Sentimentla_step4
  9. Click into the Text box and select Description from the Dynamic Contentsentiment2
  10. Click New Step
  11. Click Add an actionla_step3
  12. Enter “Dyn” into the search box
  13. Select Dynamics 365 – Update a record
  14. Select the Organization Name for your CRM instance
  15. For Entity Name, select Cases
  16. Click into the Record identifier box and select Case from the Dynamic Contentrecordidentifier
  17. Click into the Case Sentiment Score box (i.e. the field that you created in Step 1) and select Score from the Dynamic Contentcasesentimentscore
  18. Click into the Case Title box and select Case Title from the Dynamic Contentcasetitle2
  19. Click into the Customer box and select Customer from the Dynamic Contentcustomer
  20. Click Save

Test and play

All that’s left now is to test it out.  Create a few services cases that have descriptions with different ‘happiness’, wait a few seconds for the Azure service to run, then refresh the Case page to see the sentiment score.

For example, this description…

“Customer felt let down by a late delivery, when they called in they were stuck in a ‘your call is important to us’ queue for 10 minutes.  Customer eventually hung up.”

…produces a Sentiment Score of 0.04, i.e. very unhappy.

and this description…

“Just want to say thanks for the super quick delivery, I really feel you went out of your way to get the parcel to me on time. Will definitely recommend your great service to my friends!”

…produces a Sentiment Score of 0.97, i.e.very happy.

Use cases

There are a couple of use cases I see for this capability.

The first is that once you have quantified sentiment into a score, the CRM system can easily identify customers who are not best pleased and move their cases into a higher priority queue. Dealing with these customers as quickly as possible is more likely to improve satisfaction.

The second use case is in pre-warning the case agent that the customer is unhappy before the agent makes any follow-up calls.  With a quantified sentiment score, a visual flag or status can be set on the CRM system to warn the agent that extra sensitivity is required, which once again is more likely to result in improved satisfaction.

daniel_good

Advertisements

2 thoughts on “Understand the sentiment of your customers’ tickets with Azure Cognitive Services

  1. This is a great article showing how easy it is to create logic apps integrated with Dynamics, thanks. I think there is an extra point #23 which is that you have to run the app after saving it so it picks up the events.

    I produced a similar example using the description field on email and it doesn’t seem to work properly as if I create an email with body of ‘I hate you’ I get a score of 0.99749!

    Like

    • Thanks David, glad the article was useful.
      Re. running the logic app after saving it, I believe (and I may be wrong here) that clicking Run Trigger is only necessary if you want to force the trigger to run immediately – i.e. to test it. This is useful when the trigger frequency of the logic app is, say, an hour, and you don’t want to wait the full hour to see if it’s working as expected. As I say, could be wrong.
      Re. the odd results on the email description, I definitely recommend raising a support ticket on the Azure portal, they’ve been pretty helpful when I’ve done so in the past.
      Cheers, D.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s