-
Notifications
You must be signed in to change notification settings - Fork 17
ToneAnalyzer
Michael edited this page Mar 13, 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.
public class ToneAnalyzer
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 ToneAnalyzerModel.
public function Tone(ToneAnalyzerModel $model);
### Sample
```php
$analyzer = new ToneAnalyzer(WatsonCredential::initWithCredentials('your_username', 'your_password'));
$model = new ToneAnalyzerModel('your text to be analyzed');
$result = $analyzer->Tone($model);
Copyright 2017 GCG GBS CTO Office under the Apache 2.0 license.