Section: Blog

How to implement Einstein Emotion Analysis in Salesforce

Written by Saad Murad | Apr 5, 2020 11:56:07 AM

Abstract
Emotion recognition is a process of detecting or identifying human emotion, most commonly from facial expressions as well as from expressions. Machine learning and artificial intelligence techniques are used for the automatic analysis of human feelings or emotions from verbal expressions. In this article, we will discuss the options for integrating Emotion Analysis with the Salesforce instance, so that you will be able to perform an analysis of human emotions from verbal expressions that clients make every day with your organization.
Introduction
Human Emotion Identifications plays a significant role in interpersonal communication. Emotions are identified from voice, hand, gestures of the human body, and facial expressions. Therefore, understanding and analyzing emotion have a great importance of the intercommunication between humans and machines. To show recommendations or the “Next Best Action” that the Support Representative can perform dependent on the analyzed emotion, we will use Einstein Next Best Action (NBA).
                       
                                                            Einstein Next Best Action

APIs that Perform Emotional Analysis
There are several free APIs that provides you freemium based Emotion Analysis. One of the most significant API that Salesforce offer is Einstein.
The following APIs are also noteworthy.
    oIBM Watson Tone Analyzer.
    oGoogle Cloud Natural Language API.
    oMicrosoft Text Analytics API.
    oAmazon Comprehend API.
    oIndico.
There are numerous other platforms that offer the same Emotional Analysis Services. Each of these services has their own limitations. For instance, the Einstein Sentiment permits you to identify only 1000 times within a month.

Creating Suggestions and Flows for different Emotions
Here, we will create two types of recommendations.
    •What should the Support Representative do when the client is Happy?
    •What should the Support Representative do when the client is Sad?

We will apply a formula to map different emotions that will be determined by Indico.
         
   
By considering the above picture, we will be creating two Recommendations in Salesforce i.e. Sad and Happy. You need to create two Active Flows before creating Recommendations.

Einstein Next Best Action in Salesforce
The Next Best Action mostly shows the Recommendation records dependent on filters. You need to identify the execution of the Recommendation on the recommendation record.
For Instance, if the client is cheerful or happy, prompt the Support Representative to send an email. If the client is unhappy or angry, prompt the Support Representative to activate a warranty. Thus, Recommendation here is basically the prompt that generates a message such as “Please send a Thank You email” or “Activate Warranty” though the execution of the Recommendation is attained through Flows, so, it is significant to use a Flow to execute the Recommendation i.e. the procedure of sending the email or to activate a warranty.
Creating Flows
We will create two Flows that would check two checkboxes on the Case Record.
                     
Make sure that in both the flows i.e. “Send Email” and “Activate Warranty”, you have a text type variable named as recordId to store the Case Id
                   
Creating Recommendations in Salesforce
At this point, you need to create Recommendation records in Salesforce. To create Recommendations, you need to open the App Launcher and click on the Recommendation tab. Create two Recommendations i.e. Happy and Sad.
         
                                       Creating New Recommendation in Salesforce
           
                                                        Sad Recommendation
           
                                                        Happy Recommendation
Creating Strategies
In this step, we need to create two strategies that would display the Recommendation on the Case board on the identified emotion by running multiple queries. To create Strategies, consider the following steps.
    oType “Next Best” in the Setup.
    oClick on New Strategy.
    oDrag a Load Element on to the canvas.
    oSpecify the content such as Label, description, API name, Load recommendation and so on.
    oSave the Strategy.
                   
                                               Happy Recommendation Strategy
                   
                                                       Sad Recommendation Strategy

Inserting Einstein Next Best Action to the Record Page
At this moment, we have to edit the Case Record Page and insert two Einstein Next Best Action elements and arrange them.
       
Conclusion
By concluding this article, I have shown you how to implement Einstein Emotional Analysis in Salesforce using Recommendations, Flows, and Strategies or the “Next Best Action” to your support Representative by integrating Einstein Next Best Action with Emotional Analysis.