The Emotion model in the Watson Natural Language Processing classification workflow classifies the emotion in the input text.
Workflow name
emotion_aggregated-workflow_en_stock
emotion_aggregated-workflow_fr_stock
Supported languages
English and French
Capabilities
The Emotion classification model is a pre-trained document classification model for the task of classifying the emotion in the input document. The model identifies the emotion of a document, and classifies it as:
Anger
Disgust
Fear
Joy
Sadness
Unlike the Sentiment model, which classifies each individual sentence, the Emotion model classifies the entire input document. As such, the Emotion model works optimally when the input text to classify is no longer than 1000 characters. If you
would like to classify texts longer than 1000 characters, split the text into sentences or paragraphs for example and apply the Emotion model on each sentence or paragraph.
A document may be classified into multiple categories or into no category.
Capabilities of emotion classification based on an example
Capabilities
Example
Identifies the emotion of a document and classifies it
"I'm so annoyed that this code won't run --> anger, sadness
Dependencies on other blocks
None
Code sample
import watson_nlp
# Load the Emotion workflow model for English
emotion_model = watson_nlp.load('emotion_aggregated-workflow_en_stock')
# Run the Tone model
emotion_result = emotion_model.run("I'm so annoyed that this code won't run")
print(emotion_result)
About cookies on this siteOur websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising.For more information, please review your cookie preferences options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.