How to add the Cognitive Sentiment robot skill
- Load the most recent release of ARC (Get ARC).
- Press the Project tab from the top menu bar in ARC.
- Press Add Robot Skill from the button ribbon bar in ARC.
- Choose the Artificial Intelligence category tab.
- Press the Cognitive Sentiment icon to add the robot skill to your project.
Don't have a robot yet?
Follow the Getting Started Guide to build a robot and use the Cognitive Sentiment robot skill.
How to use the Cognitive Sentiment robot skill
Detect the percentage of the positive sentiment of the provided phrase using cognitive machine learning services. The detected sentiment percentage will be displayed in the response window and assigned to a variable $SentimentPercentage. The text/phrase can be sent to the skill via ControlCommand() scripts.
Main Window
1. Text Field
In this field, you enter the text you want this machine learning service to evaluate.
2. Detect Button
This button will send the text you entered to the machine learning service for evaluation.
3. Average Sentiment Face
This face is a visual display of the average sentiment detected in all your text entries. The average positivity/negativity value is displayed above the face.
4. Sentiment Graph
This graph displays a point on the vertical scale for every evaluated entry and draws a line from point to point on the horizontal scale. The vertical scale represents the amount of positivity above zero and negativity below zero. The horizontal scale represents the amount of text field inputs.
5. Status Display
Displays the text entry and the percentage of the Sentiments that are detected.
How to use Cognitive Sentiment
1) Add the Cognitive Sentiment skill to your ARC project (Project -> Add Skill -> Artificial Intelligence -> Cognitive Sentiment).
2) Enter your text into the text field, hit enter, or press the Detect button.
3) Read the sentiment percentage in the status display, look at the sentiment face, and observe the change in the Sentiment graph.
Code Samples
You can send a phrase to this skill using the provided ControlCommand() listed in the Cheat Sheet. For example, you can send the phrase:ControlCommand("Sentiment", Detect, "I love sunny days")
or use a variable...
ControlCommand("Sentiment", Detect, $MyText)
The response of the detected sentiment percentage is stored in the global variable $SentimentPercentage.