blob: 1e4b29a006dc6fb0e0076393755e2470888bd83a [file] [log] [blame]
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070075<h1><a href="language_v1beta2.html">Cloud Natural Language API</a> . <a href="language_v1beta2.documents.html">documents</a></h1>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040076<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#analyzeEntities">analyzeEntities(body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040079<p class="firstline">Finds named entities (currently proper names and common nouns) in the text</p>
80<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#analyzeEntitySentiment">analyzeEntitySentiment(body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040082<p class="firstline">Finds entities, similar to AnalyzeEntities in the text and analyzes</p>
83<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070084 <code><a href="#analyzeSentiment">analyzeSentiment(body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040085<p class="firstline">Analyzes the sentiment of the provided text.</p>
86<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#analyzeSyntax">analyzeSyntax(body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040088<p class="firstline">Analyzes the syntax of the text and provides sentence boundaries and</p>
89<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code><a href="#annotateText">annotateText(body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040091<p class="firstline">A convenience method that provides all syntax, sentiment, entity, and</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070092<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#classifyText">classifyText(body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Classifies a document into categories.</p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040095<h3>Method Details</h3>
96<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070097 <code class="details" id="analyzeEntities">analyzeEntities(body=None, x__xgafv=None)</code>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040098 <pre>Finds named entities (currently proper names and common nouns) in the text
99along with entity types, salience, mentions for each entity, and
100other properties.
101
102Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700103 body: object, The request body.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400104 The object takes the form of:
105
106{ # The entity analysis request message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700107 &quot;document&quot;: { # ################################################################ # # Required. Input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400108 #
109 # Represents the input to API methods.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700110 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
111 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700112 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400113 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700114 # accepted.&lt;br&gt;
115 # [Language
116 # Support](https://cloud.google.com/natural-language/docs/languages) lists
117 # currently supported languages for each API method. If the language (either
118 # specified by the caller or automatically detected) is not supported by the
119 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700120 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
121 # returns an `INVALID_ARGUMENT` error.
122 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
123 # This URI must be of the form: gs://bucket_name/object_name. For more
124 # details, see https://cloud.google.com/storage/docs/reference-uris.
125 # NOTE: Cloud Storage object versioning is not supported.
126 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
127 # Cloud audit logging exempt since it is based on user data.
128 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
129 # declarations, banners) should be handled for this document. If not
130 # specified, boilerplate will be treated the same as content.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400131 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700132 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400133 }
134
135 x__xgafv: string, V1 error format.
136 Allowed values
137 1 - v1 error format
138 2 - v2 error format
139
140Returns:
141 An object of the form:
142
143 { # The entity analysis response message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700144 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
145 # in the request or, if not specified, the automatically-detected language.
146 # See Document.language field for more details.
147 &quot;entities&quot;: [ # The recognized entities in the input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400148 { # Represents a phrase in the text that is a known entity, such as
149 # a person, an organization, or location. The API associates information, such
150 # as salience and mentions, with entities.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700151 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
152 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
153 # true, this field will contain the aggregate sentiment expressed for this
154 # entity in the provided document.
155 # the text.
156 # Next ID: 6
157 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
158 # the absolute magnitude of sentiment regardless of score (positive or
159 # negative).
160 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
161 # (positive sentiment).
162 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700163 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700164 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
165 # supports proper noun mentions.
166 { # Represents a mention for an entity in the text. Currently, proper noun
167 # mentions are supported.
168 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
169 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
170 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
171 # true, this field will contain the sentiment expressed for this mention of
172 # the entity in the provided document.
173 # the text.
174 # Next ID: 6
175 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
176 # the absolute magnitude of sentiment regardless of score (positive or
177 # negative).
178 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
179 # (positive sentiment).
180 },
181 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
182 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
183 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
184 # document according to the EncodingType specified in the API request.
185 },
186 },
187 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700188 &quot;type&quot;: &quot;A String&quot;, # The entity type.
189 &quot;metadata&quot;: { # Metadata associated with the entity.
190 #
191 # For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
192 # and Knowledge Graph MID (`mid`), if they are available. For the metadata
193 # associated with other entity types, see the Type table below.
194 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400195 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700196 &quot;salience&quot;: 3.14, # The salience score associated with the entity in the [0, 1.0] range.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400197 #
198 # The salience score for an entity provides information about the
199 # importance or centrality of that entity to the entire document text.
200 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
201 # salient.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400202 },
203 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400204 }</pre>
205</div>
206
207<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700208 <code class="details" id="analyzeEntitySentiment">analyzeEntitySentiment(body=None, x__xgafv=None)</code>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400209 <pre>Finds entities, similar to AnalyzeEntities in the text and analyzes
210sentiment associated with each entity and its mentions.
211
212Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700213 body: object, The request body.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400214 The object takes the form of:
215
216{ # The entity-level sentiment analysis request message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700217 &quot;document&quot;: { # ################################################################ # # Required. Input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400218 #
219 # Represents the input to API methods.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700220 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
221 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700222 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400223 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700224 # accepted.&lt;br&gt;
225 # [Language
226 # Support](https://cloud.google.com/natural-language/docs/languages) lists
227 # currently supported languages for each API method. If the language (either
228 # specified by the caller or automatically detected) is not supported by the
229 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700230 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
231 # returns an `INVALID_ARGUMENT` error.
232 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
233 # This URI must be of the form: gs://bucket_name/object_name. For more
234 # details, see https://cloud.google.com/storage/docs/reference-uris.
235 # NOTE: Cloud Storage object versioning is not supported.
236 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
237 # Cloud audit logging exempt since it is based on user data.
238 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
239 # declarations, banners) should be handled for this document. If not
240 # specified, boilerplate will be treated the same as content.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400241 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700242 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400243 }
244
245 x__xgafv: string, V1 error format.
246 Allowed values
247 1 - v1 error format
248 2 - v2 error format
249
250Returns:
251 An object of the form:
252
253 { # The entity-level sentiment analysis response message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700254 &quot;entities&quot;: [ # The recognized entities in the input document with associated sentiments.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400255 { # Represents a phrase in the text that is a known entity, such as
256 # a person, an organization, or location. The API associates information, such
257 # as salience and mentions, with entities.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700258 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
259 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
260 # true, this field will contain the aggregate sentiment expressed for this
261 # entity in the provided document.
262 # the text.
263 # Next ID: 6
264 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
265 # the absolute magnitude of sentiment regardless of score (positive or
266 # negative).
267 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
268 # (positive sentiment).
269 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700270 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700271 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
272 # supports proper noun mentions.
273 { # Represents a mention for an entity in the text. Currently, proper noun
274 # mentions are supported.
275 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
276 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
277 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
278 # true, this field will contain the sentiment expressed for this mention of
279 # the entity in the provided document.
280 # the text.
281 # Next ID: 6
282 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
283 # the absolute magnitude of sentiment regardless of score (positive or
284 # negative).
285 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
286 # (positive sentiment).
287 },
288 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
289 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
290 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
291 # document according to the EncodingType specified in the API request.
292 },
293 },
294 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700295 &quot;type&quot;: &quot;A String&quot;, # The entity type.
296 &quot;metadata&quot;: { # Metadata associated with the entity.
297 #
298 # For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
299 # and Knowledge Graph MID (`mid`), if they are available. For the metadata
300 # associated with other entity types, see the Type table below.
301 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400302 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700303 &quot;salience&quot;: 3.14, # The salience score associated with the entity in the [0, 1.0] range.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400304 #
305 # The salience score for an entity provides information about the
306 # importance or centrality of that entity to the entire document text.
307 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
308 # salient.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400309 },
310 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700311 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400312 # in the request or, if not specified, the automatically-detected language.
313 # See Document.language field for more details.
314 }</pre>
315</div>
316
317<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700318 <code class="details" id="analyzeSentiment">analyzeSentiment(body=None, x__xgafv=None)</code>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400319 <pre>Analyzes the sentiment of the provided text.
320
321Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700322 body: object, The request body.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400323 The object takes the form of:
324
325{ # The sentiment analysis request message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700326 &quot;document&quot;: { # ################################################################ # # Required. Input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400327 #
328 # Represents the input to API methods.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700329 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
330 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700331 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400332 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700333 # accepted.&lt;br&gt;
334 # [Language
335 # Support](https://cloud.google.com/natural-language/docs/languages) lists
336 # currently supported languages for each API method. If the language (either
337 # specified by the caller or automatically detected) is not supported by the
338 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700339 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
340 # returns an `INVALID_ARGUMENT` error.
341 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
342 # This URI must be of the form: gs://bucket_name/object_name. For more
343 # details, see https://cloud.google.com/storage/docs/reference-uris.
344 # NOTE: Cloud Storage object versioning is not supported.
345 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
346 # Cloud audit logging exempt since it is based on user data.
347 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
348 # declarations, banners) should be handled for this document. If not
349 # specified, boilerplate will be treated the same as content.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400350 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700351 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate sentence offsets for the
352 # sentence sentiment.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400353 }
354
355 x__xgafv: string, V1 error format.
356 Allowed values
357 1 - v1 error format
358 2 - v2 error format
359
360Returns:
361 An object of the form:
362
363 { # The sentiment analysis response message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700364 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400365 # in the request or, if not specified, the automatically-detected language.
366 # See Document.language field for more details.
Bu Sun Kim65020912020-05-20 12:08:20 -0700367 &quot;sentences&quot;: [ # The sentiment for all the sentences in the document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400368 { # Represents a sentence in the input document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700369 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700370 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700371 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400372 # document according to the EncodingType specified in the API request.
373 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700374 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400375 # AnnotateTextRequest.Features.extract_document_sentiment is set to
376 # true, this field will contain the sentiment for the sentence.
377 # the text.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700378 # Next ID: 6
Bu Sun Kim65020912020-05-20 12:08:20 -0700379 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400380 # the absolute magnitude of sentiment regardless of score (positive or
381 # negative).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700382 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
383 # (positive sentiment).
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400384 },
385 },
386 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700387 &quot;documentSentiment&quot;: { # Represents the feeling associated with the entire text or entities in # The overall sentiment of the input document.
388 # the text.
389 # Next ID: 6
390 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
391 # the absolute magnitude of sentiment regardless of score (positive or
392 # negative).
393 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
394 # (positive sentiment).
395 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400396 }</pre>
397</div>
398
399<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700400 <code class="details" id="analyzeSyntax">analyzeSyntax(body=None, x__xgafv=None)</code>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400401 <pre>Analyzes the syntax of the text and provides sentence boundaries and
402tokenization along with part of speech tags, dependency trees, and other
403properties.
404
405Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700406 body: object, The request body.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400407 The object takes the form of:
408
409{ # The syntax analysis request message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700410 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
411 &quot;document&quot;: { # ################################################################ # # Required. Input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400412 #
413 # Represents the input to API methods.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700414 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
415 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700416 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400417 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700418 # accepted.&lt;br&gt;
419 # [Language
420 # Support](https://cloud.google.com/natural-language/docs/languages) lists
421 # currently supported languages for each API method. If the language (either
422 # specified by the caller or automatically detected) is not supported by the
423 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700424 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
425 # returns an `INVALID_ARGUMENT` error.
426 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
427 # This URI must be of the form: gs://bucket_name/object_name. For more
428 # details, see https://cloud.google.com/storage/docs/reference-uris.
429 # NOTE: Cloud Storage object versioning is not supported.
430 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
431 # Cloud audit logging exempt since it is based on user data.
432 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
433 # declarations, banners) should be handled for this document. If not
434 # specified, boilerplate will be treated the same as content.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400435 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400436 }
437
438 x__xgafv: string, V1 error format.
439 Allowed values
440 1 - v1 error format
441 2 - v2 error format
442
443Returns:
444 An object of the form:
445
446 { # The syntax analysis response message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700447 &quot;sentences&quot;: [ # Sentences in the input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400448 { # Represents a sentence in the input document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700449 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700450 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700451 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400452 # document according to the EncodingType specified in the API request.
453 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700454 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400455 # AnnotateTextRequest.Features.extract_document_sentiment is set to
456 # true, this field will contain the sentiment for the sentence.
457 # the text.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700458 # Next ID: 6
Bu Sun Kim65020912020-05-20 12:08:20 -0700459 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400460 # the absolute magnitude of sentiment regardless of score (positive or
461 # negative).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700462 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
463 # (positive sentiment).
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400464 },
465 },
466 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700467 &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
468 { # Represents the smallest syntactic building block of the text.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700469 &quot;text&quot;: { # Represents an output piece of text. # The token text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700470 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700471 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
472 # document according to the EncodingType specified in the API request.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700473 },
474 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
475 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
476 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
477 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
478 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
479 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
480 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
481 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
482 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
483 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
484 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
485 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
486 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
487 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700488 },
489 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700490 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700491 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
492 # This is the index of the token which has an arc going to this token.
493 # The index is the position of the token in the array of tokens returned
494 # by the API method. If this token is a root token, then the
495 # `head_token_index` is its own index.
Bu Sun Kim65020912020-05-20 12:08:20 -0700496 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700497 },
498 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700499 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
500 # in the request or, if not specified, the automatically-detected language.
501 # See Document.language field for more details.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400502 }</pre>
503</div>
504
505<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700506 <code class="details" id="annotateText">annotateText(body=None, x__xgafv=None)</code>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400507 <pre>A convenience method that provides all syntax, sentiment, entity, and
508classification features in one call.
509
510Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700511 body: object, The request body.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400512 The object takes the form of:
513
514{ # The request message for the text annotation API, which can perform multiple
515 # analysis types (sentiment, entities, and syntax) in one call.
Bu Sun Kim65020912020-05-20 12:08:20 -0700516 &quot;document&quot;: { # ################################################################ # # Required. Input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400517 #
518 # Represents the input to API methods.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700519 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
520 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700521 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400522 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700523 # accepted.&lt;br&gt;
524 # [Language
525 # Support](https://cloud.google.com/natural-language/docs/languages) lists
526 # currently supported languages for each API method. If the language (either
527 # specified by the caller or automatically detected) is not supported by the
528 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700529 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
530 # returns an `INVALID_ARGUMENT` error.
531 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
532 # This URI must be of the form: gs://bucket_name/object_name. For more
533 # details, see https://cloud.google.com/storage/docs/reference-uris.
534 # NOTE: Cloud Storage object versioning is not supported.
535 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
536 # Cloud audit logging exempt since it is based on user data.
537 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
538 # declarations, banners) should be handled for this document. If not
539 # specified, boilerplate will be treated the same as content.
540 },
541 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
542 &quot;features&quot;: { # All available features for sentiment, syntax, and semantic analysis. # Required. The enabled features.
543 # Setting each one to true will enable that specific analysis for the input.
544 # Next ID: 10
545 &quot;extractEntities&quot;: True or False, # Extract entities.
546 &quot;extractDocumentSentiment&quot;: True or False, # Extract document-level sentiment.
547 &quot;extractSyntax&quot;: True or False, # Extract syntax information.
548 &quot;classifyText&quot;: True or False, # Classify the full document into categories. If this is true,
549 # the API will use the default model which classifies into a
550 # [predefined
551 # taxonomy](https://cloud.google.com/natural-language/docs/categories).
552 &quot;extractEntitySentiment&quot;: True or False, # Extract entities and their associated sentiment.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400553 },
554 }
555
556 x__xgafv: string, V1 error format.
557 Allowed values
558 1 - v1 error format
559 2 - v2 error format
560
561Returns:
562 An object of the form:
563
564 { # The text annotations response message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700565 &quot;entities&quot;: [ # Entities, along with their semantic information, in the input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400566 # Populated if the user enables
567 # AnnotateTextRequest.Features.extract_entities.
568 { # Represents a phrase in the text that is a known entity, such as
569 # a person, an organization, or location. The API associates information, such
570 # as salience and mentions, with entities.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700571 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
572 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
573 # true, this field will contain the aggregate sentiment expressed for this
574 # entity in the provided document.
575 # the text.
576 # Next ID: 6
577 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
578 # the absolute magnitude of sentiment regardless of score (positive or
579 # negative).
580 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
581 # (positive sentiment).
582 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700583 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700584 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
585 # supports proper noun mentions.
586 { # Represents a mention for an entity in the text. Currently, proper noun
587 # mentions are supported.
588 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
589 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
590 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
591 # true, this field will contain the sentiment expressed for this mention of
592 # the entity in the provided document.
593 # the text.
594 # Next ID: 6
595 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
596 # the absolute magnitude of sentiment regardless of score (positive or
597 # negative).
598 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
599 # (positive sentiment).
600 },
601 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
602 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
603 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
604 # document according to the EncodingType specified in the API request.
605 },
606 },
607 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700608 &quot;type&quot;: &quot;A String&quot;, # The entity type.
609 &quot;metadata&quot;: { # Metadata associated with the entity.
610 #
611 # For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
612 # and Knowledge Graph MID (`mid`), if they are available. For the metadata
613 # associated with other entity types, see the Type table below.
614 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400615 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700616 &quot;salience&quot;: 3.14, # The salience score associated with the entity in the [0, 1.0] range.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400617 #
618 # The salience score for an entity provides information about the
619 # importance or centrality of that entity to the entire document text.
620 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
621 # salient.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700622 },
623 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700624 &quot;documentSentiment&quot;: { # Represents the feeling associated with the entire text or entities in # The overall sentiment for the document. Populated if the user enables
625 # AnnotateTextRequest.Features.extract_document_sentiment.
626 # the text.
627 # Next ID: 6
628 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
629 # the absolute magnitude of sentiment regardless of score (positive or
630 # negative).
631 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
632 # (positive sentiment).
633 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700634 &quot;sentences&quot;: [ # Sentences in the input document. Populated if the user enables
635 # AnnotateTextRequest.Features.extract_syntax.
636 { # Represents a sentence in the input document.
637 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700638 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700639 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
640 # document according to the EncodingType specified in the API request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700641 },
642 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
643 # AnnotateTextRequest.Features.extract_document_sentiment is set to
644 # true, this field will contain the sentiment for the sentence.
645 # the text.
646 # Next ID: 6
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700647 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
648 # the absolute magnitude of sentiment regardless of score (positive or
649 # negative).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700650 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
651 # (positive sentiment).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700652 },
653 },
654 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700655 &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
656 # Populated if the user enables
657 # AnnotateTextRequest.Features.extract_syntax.
658 { # Represents the smallest syntactic building block of the text.
659 &quot;text&quot;: { # Represents an output piece of text. # The token text.
660 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
661 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
662 # document according to the EncodingType specified in the API request.
663 },
664 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
665 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
666 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
667 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
668 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
669 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
670 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
671 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
672 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
673 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
674 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
675 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
676 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
677 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
678 },
679 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
680 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
681 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
682 # This is the index of the token which has an arc going to this token.
683 # The index is the position of the token in the array of tokens returned
684 # by the API method. If this token is a root token, then the
685 # `head_token_index` is its own index.
686 },
687 },
688 ],
689 &quot;categories&quot;: [ # Categories identified in the input document.
690 { # Represents a category returned from the text classifier.
691 &quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document, from the [predefined
692 # taxonomy](https://cloud.google.com/natural-language/docs/categories).
693 &quot;confidence&quot;: 3.14, # The classifier&#x27;s confidence of the category. Number represents how certain
694 # the classifier is that this category represents the given text.
695 },
696 ],
697 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
698 # in the request or, if not specified, the automatically-detected language.
699 # See Document.language field for more details.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700700 }</pre>
701</div>
702
703<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700704 <code class="details" id="classifyText">classifyText(body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700705 <pre>Classifies a document into categories.
706
707Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700708 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700709 The object takes the form of:
710
711{ # The document classification request message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700712 &quot;document&quot;: { # ################################################################ # # Required. Input document.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700713 #
714 # Represents the input to API methods.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700715 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
716 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700717 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700718 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700719 # accepted.&lt;br&gt;
720 # [Language
721 # Support](https://cloud.google.com/natural-language/docs/languages) lists
722 # currently supported languages for each API method. If the language (either
723 # specified by the caller or automatically detected) is not supported by the
724 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700725 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
726 # returns an `INVALID_ARGUMENT` error.
727 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
728 # This URI must be of the form: gs://bucket_name/object_name. For more
729 # details, see https://cloud.google.com/storage/docs/reference-uris.
730 # NOTE: Cloud Storage object versioning is not supported.
731 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
732 # Cloud audit logging exempt since it is based on user data.
733 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
734 # declarations, banners) should be handled for this document. If not
735 # specified, boilerplate will be treated the same as content.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700736 },
737 }
738
739 x__xgafv: string, V1 error format.
740 Allowed values
741 1 - v1 error format
742 2 - v2 error format
743
744Returns:
745 An object of the form:
746
747 { # The document classification response message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700748 &quot;categories&quot;: [ # Categories representing the input document.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700749 { # Represents a category returned from the text classifier.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700750 &quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document, from the [predefined
751 # taxonomy](https://cloud.google.com/natural-language/docs/categories).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700752 &quot;confidence&quot;: 3.14, # The classifier&#x27;s confidence of the category. Number represents how certain
753 # the classifier is that this category represents the given text.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700754 },
755 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400756 }</pre>
757</div>
758
759</body></html>