You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: natural-language-understanding/src/main/java/com/ibm/watson/developer_cloud/natural_language_understanding/v1/model/DocumentSentimentResults.java
Copy file name to clipboardExpand all lines: natural-language-understanding/src/test/java/com/ibm/watson/developer_cloud/natural_language_understanding/v1/NaturalLanguageUnderstandingTest.java
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -257,7 +257,9 @@ public void testModelOptions1() throws InterruptedException {
* Uses the general purpose endpoint to analyze the tone of your input content. The service can analyze the input for
102
-
* several tones: emotion, language, and social. It derives various characteristics for each tone that it analyzes.
103
-
* The method always analyzes the tone of the full document; by default, it also analyzes the tone of each individual
104
-
* sentence of the input. You can submit a maximum of 128 KB of content in JSON, plain text, or HTML format. Per
105
-
* the JSON specification, the default character encoding for JSON content is effectively always UTF-8; per the
106
-
* HTTP specification, the default encoding for plain text and HTML is ISO-8859-1 (effectively, the ASCII character
107
-
* set). When specifying a content type of plain text or HTML, include the `charset` parameter to indicate the
108
-
* character encoding of the input text; for example: `Content-Type: text/plain;charset=utf-8`. For `text/html`,
109
-
* the service removes HTML tags and analyzes only the textual content. Use the `POST` request method to analyze
110
-
* larger amounts of content in any of the available formats. Use the `GET` request method to analyze smaller
111
-
* quantities of plain text content.
99
+
* Uses the general purpose endpoint to analyze the tone of your input content. The service analyzes the content for emotional and language tones. The method always analyzes the tone of the full document; by default, it also analyzes the tone of each individual sentence of the content. You can submit no more than 128 KB of total input content and no more than 1000 individual sentences in JSON, plain text, or HTML format. The service analyzes the first 1000 sentences for document-level analysis and only the first 100 sentences for sentence-level analysis. Use the `POST` request method to analyze larger amounts of content in any of the available formats. Use the `GET` request method to analyze smaller quantities of plain text content. Per the JSON specification, the default character encoding for JSON content is effectively always UTF-8; per the HTTP specification, the default encoding for plain text and HTML is ISO-8859-1 (effectively, the ASCII character set). When specifying a content type of plain text or HTML, include the `charset` parameter to indicate the character encoding of the input text; for example: `Content-Type: text/plain;charset=utf-8`. For `text/html`, the service removes HTML tags and analyzes only the textual content. **Note:** The `tones` query parameter is no longer supported. The service continues to accept the parameter for backward-compatibility, but the parameter no longer affects the response.
112
100
*
113
101
* @param toneOptions the {@link ToneOptions} containing the options for the call
114
102
* @return the {@link ToneAnalysis} with the response
@@ -118,8 +106,11 @@ public ServiceCall<ToneAnalysis> tone(ToneOptions toneOptions) {
@@ -135,11 +126,7 @@ public ServiceCall<ToneAnalysis> tone(ToneOptions toneOptions) {
135
126
/**
136
127
* Analyze customer engagement tone.
137
128
*
138
-
* Uses the customer engagement endpoint to analyze the tone of customer service and customer support conversations.
139
-
* For each utterance of a conversation, the method reports the most prevalent subset of the following seven tones:
140
-
* sad, frustrated, satisfied, excited, polite, impolite, and sympathetic. You can submit a maximum of 128 KB of
141
-
* JSON input. Per the JSON specification, the default character encoding for JSON content is effectively always
142
-
* UTF-8.
129
+
* Use the customer engagement endpoint to analyze the tone of customer service and customer support conversations. For each utterance of a conversation, the method reports the most prevalent subset of the following seven tones: sad, frustrated, satisfied, excited, polite, impolite, and sympathetic. If you submit more than 50 utterances, the service returns a warning for the overall content and analyzes only the first 50 utterances. If you submit a single utterance that contains more than 500 characters, the service returns an error for that utterance and does not analyze the utterance. The request fails if all utterances have more than 500 characters. Per the JSON specification, the default character encoding for JSON content is effectively always UTF-8.
143
130
*
144
131
* @param toneChatOptions the {@link ToneChatOptions} containing the options for the call
145
132
* @return the {@link UtteranceAnalyses} with the response
@@ -148,6 +135,9 @@ public ServiceCall<UtteranceAnalyses> toneChat(ToneChatOptions toneChatOptions)
148
135
Validator.notNull(toneChatOptions, "toneChatOptions cannot be null");
* An array of `ToneCategory` objects that provides the results of the tone analysis for the full document of the
32
-
* input content. The service returns results only for the tones specified with the `tones` parameter of the request.
30
+
* An array of `ToneScore` objects that provides the results of the analysis for each qualifying tone of the document. The array includes results for any tone whose score is at least 0.5. The array is empty if no tone has a score that meets this threshold.
33
31
*
34
-
* @return the toneCategories
32
+
* @return the tones
35
33
*/
36
-
publicList<ToneCategory> getToneCategories() {
37
-
returntoneCategories;
34
+
publicList<ToneScore> getTones() {
35
+
returntones;
38
36
}
39
37
40
38
/**
41
-
* Sets the toneCategories.
39
+
* Gets the warning.
42
40
*
43
-
* @param toneCategories the new toneCategories
41
+
* A warning message if the overall content exceeds 128 KB or contains more than 1000 sentences. The service analyzes only the first 1000 sentences for document-level analysis and the first 100 sentences for sentence-level analysis.
0 commit comments