Skip to main content
This content is now archived and is no longer updated. Progress is not calculated. Pega Cloud instances are disabled, and badges are no longer awarded.

Routing emails based on sentiment

Introduction

When customers send emails to a contact center application, these emails are routed to one or more work queues based on the topics and routings configured. Learn how to route all emails with a negative sentiment to a specialized contact center agent.

Video

Transcript

This video will show you how to detect the sentiment of an email and how to route emails based on sentiment.

When customers send emails to a contact center application, these emails are routed to one or more work queues based on the topics and routings configured. U+ has a new requirement. U+ wants to route all emails that are about disputing a transaction and have a negative sentiment to a specialized contact center agent.

Consider two new emails. Begin by testing the two transaction dispute emails in which the customer is overall happy with the bank’s service in one and unhappy with the service in the other.

The first email is about a transaction dispute, but the customer is happy with the bank’s service, so, it has a positive sentiment.

Note that the sentiment of the email is undetected, although the customer, Sara, is generally happy with the bank’s services.

Happy email

The second email is also about a transaction dispute, but the customer is disappointed and unhappy. This email should be forwarded to a specialized agent.

Note that the sentiment of the email is undetected, although the customer, Sara, is unhappy with the bank’s service.

Unhappy email

Every channel configuration has an associated Text Analyzer. This text analyzer can be configured to detect the sentiment of an email.

To configure sentiment detection, navigate to Actions->Open Text Analyzer. To enable email sentiment detection, check the Enable sentiment detection option. Note that the sentiment model-related artifacts, pySentimentLexicon and pySentimentModels, are available out-of-the-box with the system. These models are pre-trained and usually do not require further training by data scientists. Save the change.

Artifacts

Now, test the dispute transaction email in which the customer is unhappy. Notice that the sentiment of the email is detected.

Sentiment negative

Next, configure the MySupport email channel to route all dispute emails with a negative sentiment to a specialized agent. To route an email to a specialized person, click on +Add condition. In the new condition configuration area, you can select the action, route to an operator, and specify a role. In this case, camanager. Then, add a When condition with the NLP->Sentiment as Negative. Sentiment is one of the outputs of the NLP text processing executed on the email.

Since the intelligent routing conditions are executed sequentially, you need to move the most specific condition up in the desired routing sequence.

Routing

You have completed all the configuration steps. You can now save your configuration and test the changes made.

In the email channel configuration, test the second transaction dispute email in which the customer is unhappy with the service and see how the sentiment detection and routing works. In this case, the sentiment is correctly detected as negative, and the email is routed to the agent, camanager, as configured.

CAmanager

Perform an end-to-end test to ensure the emails are detected with the correct sentiment. Send the first dispute transaction email in which the customer is generally happy with the service and verify the sentiment of the email.

Send the second dispute transaction email in which the customer is unhappy with the service. Verify the sentiment of the email and that it is routed to the right agent, camanager.

This email is listed in the agent’s My Cases section, as per the configuration.

This video has concluded. What did it show you?

  • How to enable sentiment detection in a Text Analyzer
  • How to route emails based on sentiment

This Topic is available in the following Module:

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice