Skip to content

ToneModel

Michael edited this page Mar 21, 2017 · 1 revision
namespace WatsonSDK\Services\ToneAnalyzer;

The class of parameters to be sent to ToneAnalyzer service.

class ToneModel extends ServiceModel

Used to initialize a ToneModel model from the parameters.

/**
 * Constructor
 *
 * @param $text string
 * @param $tones string | NULL
 * @param $sentences string | NULL
 * @param $version string
 */
function __construct($text = '', $tones = NULL, $sentences = NULL, $version = '2016-05-19');
Parameter Type Description
text string Text that contains the content to be analyzed. The Tone Analyzer Service supports up to 128KB of text, or about 1000 sentences. Sentences with less than three words cannot be analyzed.
tones string Filter the results by a specific tone. Valid values for tones are emotion, language, and social.
sentences string Filter your response to remove the sentence level analysis. Valid values for sentences are true and false. This parameter defaults to true when it's not set, which means that a sentence level analysis is automatically provided. Change sentences=false to filter out the sentence level analysis.
version string The release date of the version of the API to use. Specify the date in “YYYY-MM-DD” format.

Tone Analyzer service URL.

const BASE_URL = 'https://gateway.watsonplatform.net/tone-analyzer/api/v3';

Current Tone Analyzer version.

const VERSION = '2016-05-19';

Get text that contains the content to be analyzed.

public function getText();

Set text to be analyzed.

public function setText($val);

Get tones to be filtered.

public function getTones();

Set tones to filter the result.

public function setTones($val);

Get sentences for filtering sentence level analysis.

public function getSentences();

Set sentences for filtering sentence level analysis.

public function setSentences($val);
Clone this wiki locally