Automation Action: Score Sentiment
Perform Sentiment Analysis using the built-in sentiment analyzer on any text and return the score to a variable.
Performs Sentiment Analysis on any text and returns the Sentiment Score to a variable. The ThinkAutomation Sentiment Analyzer is able to detect if text is either positive or negative in sentiment or any other yes/no, positive/negative construct. You could then use the result to perform specific actions, for example, to send alert emails or SMS texts if an incoming email contains a high negative sentiment score.
Before Sentiment Analysis can work the ThinkAutomation Sentiment Analyzer must be 'trained'. The Sentiment Analyzer accuracy will improve the more it is trained. See: Train Sentiment
In the Get Sentiment Score For entry enter the text you want to analyze. Any text can be entered including %variable% replacements. To analyze the incoming message body set the value to %Msg_Body%.
The Sentiment Class Name is used to categorize the Sentiment Analysis database. For example: "Sales", "Spam" etc. Each class name stores training data separately. Class names are global to your ThinkAutomation instance. For example, a '"Sales" class name would contain the same training data across all of your Solutions.
In the Assign Sentiment Score To list select variable to assign the sentiment analysis score to.
The result will be returned as a number between 1 and 100. 100 being maximum positive sentiment and 1 being maximum negative sentiment. A result of 50 indicates neutral sentiment.
You can optionally also get a list of the most relevant tokens used in the scoring process. Select a field or variable to assign the list to from the Assign Relevant Tokens List To list.
The list is returned as a string. Each token on its own line as:
token=score,count token=score,count ...
Where score between 1 and 100. Count shows the number of occurrences of the token in the text analyzed. This list shows the tokens that have had the most effect (positive or negative) on the sentiment score.
Sentiment Analysis can be used to classify a message for any construct - not just Positive or Negative sentiment. For example, it could be used to classify a message as a sales inquiry or not. The construct is defined only by the training data. So if you trained the Sentiment Analyzer with 1000 sales inquiries and 1000 non-sales inquiry messages then it could be used to classify incoming messages as sales inquiries and then take appropriate action.
Sentiment Analyzer Control Panel
You can also use the included Sentiment Analyzer Control Panel to add training data and run run tests. See: Sentiment Analyzer Control Panel
This action uses the ThinkAutomation built-in sentiment analyzer - which requires training before it will return accurate scores but is free to use. The online Custom Action library also includes an Azure Sentiment action. This uses the pre-trained Sentiment Analyzer provided by Microsoft Cognitive Services (however this will require an Azure subscription). You can also use the ChatGPT action to perform sentiment analysis.