About cookies on this site Our 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 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.
Last updated: Jan 28, 2025
The Tone model in the Watson Natural Language Processing classification workflow classifies the tone in the input text.
Workflow name
ensemble_classification-workflow_en_tone-stock
ensemble_classification-workflow_fr_tone-stock
Supported languages
- English and French
Capabilities
The Tone classification model is a pre-trained document classification model for the task of classifying the tone in the input document. The model identifies the tone of the input document and classifies it as:
- Excited
- Frustrated
- Impolite
- Polite
- Sad
- Satisfied
- Sympathetic
Unlike the Sentiment model, which classifies each individual sentence, the Tone model classifies the entire input document. As such, the Tone 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 Tone model on each sentence or paragraph.
A document may be classified into multiple categories or into no category.
Capabilities | Example |
---|---|
Identifies the tone of a document and classifies it | "I'm really happy with how this was handled, thank you!" --> excited, satisfied |
Dependencies on other blocks
None
Code sample
import watson_nlp
# Load the Tone workflow model for English
tone_model = watson_nlp.load('ensemble_classification-workflow_en_tone-stock')
# Run the Tone model
tone_result = tone_model.run("I'm really happy with how this was handled, thank you!")
print(tone_result)
Output of the code sample:
{ "classes": [ { "class_name": "excited", "confidence": 0.6896854620082722 }, { "class_name": "satisfied", "confidence": 0.6570277557333078 }, { "class_name": "polite", "confidence": 0.33628806679460566 }, { "class_name": "sympathetic", "confidence": 0.17089694967744093 }, { "class_name": "sad", "confidence": 0.06880583874412932 }, { "class_name": "frustrated", "confidence": 0.010365418217209686 }, { "class_name": "impolite", "confidence": 0.002470793624966174 } ], "producer_id": { "name": "Voting based Ensemble", "version": "0.0.1" } }
Parent topic: Watson Natural Language Processing task catalog
Was the topic helpful?
0/1000