Class: ToneAnalyzer

ToneAnalyzer

watson.tone_analyzer({version: 'v2-experimental', ...});

Parameters:
Name Type Description
options
Source:

Methods

scorecards()

Returns the different scorecards implemented by the service. This is an array of objects with a "name" and "description" properties. As a first version, only a "business email" scorecard is implemented.
Source:
See:
  • the API docs for a the full documentation.

synonym(params:)

Returns related words for a given word (or set of words).
Parameters:
Name Type Description
params: An object to build the query string. It normally contains a property "word", the term to look up. Alternatively, one can specify a "context" (part of a phrase) and an "index" (of the word to lookup, within "context"). A 'limit' parameter is also accepted to limit the number of related words suggested.
Source:
See:
  • the API docs for a the full documentation.
Returns:
upon success, the callback function is called with an object containing related words to the ones given. Each word comes with the semantic type and the meaning and sense of the root word, and a weight associated to a trait. Positive weights would 'level up' that particular tone, while negative weights would level it down. For example, if one wants to sound less "angry" on a message, the suggestions with negative correlation with "Anger" (Emotion Tone) could be replaced in the txt.

tone(params:)

Main API call. Returns the different tone dimensions of a text.
Parameters:
Name Type Description
params: An object with a string 'text' element. This is the only field used. By this API call
Source:
See:
  • the API docs for a the full documentation.
Returns:
upon success, the callback function is called with an object containing the different tones (emotion, writing and social), traits and the evidence words found in the text.

tone(params:)

Main API call. Returns the different tone dimensions of a text.
Parameters:
Name Type Description
params: An object with a string 'text' element. This is the only field used. By this API call
Source:
See:
  • the API docs for a the full documentation.
Returns:
upon success, the callback function is called with an object containing the different tones (emotion, writing and social), traits and the evidence words found in the text.