Skip to content

ToneAnalyzer

Michael edited this page Mar 4, 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);

Analyze the tone of the given instance of ToneAnalyzerModel.

public function Tone(ToneAnalyzerModel $model);


### Sample
```php
$analyzer = new ToneAnalyzer(WatsonCredential::initWithCredentials('your_username', 'your_password'));

$model = new ToneAnalyzerModel('I am so happy!');
$result = $analyzer->Tone($model);

Clone this wiki locally