-
Notifications
You must be signed in to change notification settings - Fork 17
ToneAnalyzer
Michael edited this page Mar 21, 2017
·
6 revisions
namespace WatsonSDK\Services;
The IBM Watson Tone Analyzer service uses linguistic analysis to detect emotional tones, social propensities, and writing styles in written communication. Then it offers suggestions to help the writer improve their intended language tones.
class ToneAnalyzer extends WatsonService
Used to initialize a ToneAnalyzer instance from the instance of WatsonCredential.
function __construct(WatsonCredential $credential);
Analyzes the tone of a piece of text. The message is analyzed for several tones - social, emotional, and language. For each tone, various traits are derived. For example, conscientiousness, agreeableness, and openness.
The parameters can be set in the given instance of WatsonSDK\Services\ToneAnalyzer\ToneModel
.
public function Tone(ToneModel $model);
$analyzer = new ToneAnalyzer(WatsonCredential::initWithCredentials('your_username', 'your_password'));
$model = new ToneModel('your text to be analyzed.');
$result = $analyzer->getTone($model);
Copyright 2017 GCG GBS CTO Office under the Apache 2.0 license.