blob: 2e55c66d8bf163e15d1bcf4728e190bfd76528df [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;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
108 &quot;document&quot;: { # ################################################################ # # Required. Input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400109 #
110 # Represents the input to API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -0700111 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
112 # This URI must be of the form: gs://bucket_name/object_name. For more
113 # details, see https://cloud.google.com/storage/docs/reference-uris.
114 # NOTE: Cloud Storage object versioning is not supported.
115 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
116 # declarations, banners) should be handled for this document. If not
117 # specified, boilerplate will be treated the same as content.
118 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
119 # returns an `INVALID_ARGUMENT` error.
120 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
121 # Cloud audit logging exempt since it is based on user data.
122 &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 -0400123 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700124 # accepted.&lt;br&gt;
125 # [Language
126 # Support](https://cloud.google.com/natural-language/docs/languages) lists
127 # currently supported languages for each API method. If the language (either
128 # specified by the caller or automatically detected) is not supported by the
129 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700130 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
Dan O'Mearadd494642020-05-01 07:42:23 -0700131 # fetching the content, but as a hint for analyzing the document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400132 },
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 Kim65020912020-05-20 12:08:20 -0700151 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
152 &quot;type&quot;: &quot;A String&quot;, # The entity type.
153 &quot;metadata&quot;: { # Metadata associated with the entity.
154 #
155 # For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
156 # and Knowledge Graph MID (`mid`), if they are available. For the metadata
157 # associated with other entity types, see the Type table below.
158 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400159 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700160 &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 -0400161 #
162 # The salience score for an entity provides information about the
163 # importance or centrality of that entity to the entire document text.
164 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
165 # salient.
Bu Sun Kim65020912020-05-20 12:08:20 -0700166 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
167 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
168 # true, this field will contain the aggregate sentiment expressed for this
169 # entity in the provided document.
170 # the text.
171 # Next ID: 6
172 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
173 # (positive sentiment).
174 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
175 # the absolute magnitude of sentiment regardless of score (positive or
176 # negative).
177 },
178 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400179 # supports proper noun mentions.
180 { # Represents a mention for an entity in the text. Currently, proper noun
181 # mentions are supported.
Bu Sun Kim65020912020-05-20 12:08:20 -0700182 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
183 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
184 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400185 # document according to the EncodingType specified in the API request.
186 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700187 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
188 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400189 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
190 # true, this field will contain the sentiment expressed for this mention of
191 # the entity in the provided document.
192 # the text.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700193 # Next ID: 6
Bu Sun Kim65020912020-05-20 12:08:20 -0700194 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400195 # (positive sentiment).
Bu Sun Kim65020912020-05-20 12:08:20 -0700196 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400197 # the absolute magnitude of sentiment regardless of score (positive or
198 # negative).
199 },
200 },
201 ],
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;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
218 &quot;document&quot;: { # ################################################################ # # Required. Input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400219 #
220 # Represents the input to API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -0700221 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
222 # This URI must be of the form: gs://bucket_name/object_name. For more
223 # details, see https://cloud.google.com/storage/docs/reference-uris.
224 # NOTE: Cloud Storage object versioning is not supported.
225 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
226 # declarations, banners) should be handled for this document. If not
227 # specified, boilerplate will be treated the same as content.
228 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
229 # returns an `INVALID_ARGUMENT` error.
230 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
231 # Cloud audit logging exempt since it is based on user data.
232 &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 -0400233 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700234 # accepted.&lt;br&gt;
235 # [Language
236 # Support](https://cloud.google.com/natural-language/docs/languages) lists
237 # currently supported languages for each API method. If the language (either
238 # specified by the caller or automatically detected) is not supported by the
239 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700240 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
Dan O'Mearadd494642020-05-01 07:42:23 -0700241 # fetching the content, but as a hint for analyzing the document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400242 },
243 }
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 Kim65020912020-05-20 12:08:20 -0700258 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
259 &quot;type&quot;: &quot;A String&quot;, # The entity type.
260 &quot;metadata&quot;: { # Metadata associated with the entity.
261 #
262 # For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
263 # and Knowledge Graph MID (`mid`), if they are available. For the metadata
264 # associated with other entity types, see the Type table below.
265 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400266 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700267 &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 -0400268 #
269 # The salience score for an entity provides information about the
270 # importance or centrality of that entity to the entire document text.
271 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
272 # salient.
Bu Sun Kim65020912020-05-20 12:08:20 -0700273 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
274 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
275 # true, this field will contain the aggregate sentiment expressed for this
276 # entity in the provided document.
277 # the text.
278 # Next ID: 6
279 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
280 # (positive sentiment).
281 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
282 # the absolute magnitude of sentiment regardless of score (positive or
283 # negative).
284 },
285 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400286 # supports proper noun mentions.
287 { # Represents a mention for an entity in the text. Currently, proper noun
288 # mentions are supported.
Bu Sun Kim65020912020-05-20 12:08:20 -0700289 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
290 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
291 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400292 # document according to the EncodingType specified in the API request.
293 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700294 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
295 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400296 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
297 # true, this field will contain the sentiment expressed for this mention of
298 # the entity in the provided document.
299 # the text.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700300 # Next ID: 6
Bu Sun Kim65020912020-05-20 12:08:20 -0700301 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400302 # (positive sentiment).
Bu Sun Kim65020912020-05-20 12:08:20 -0700303 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400304 # the absolute magnitude of sentiment regardless of score (positive or
305 # negative).
306 },
307 },
308 ],
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;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate sentence offsets for the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700327 # sentence sentiment.
Bu Sun Kim65020912020-05-20 12:08:20 -0700328 &quot;document&quot;: { # ################################################################ # # Required. Input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400329 #
330 # Represents the input to API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -0700331 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
332 # This URI must be of the form: gs://bucket_name/object_name. For more
333 # details, see https://cloud.google.com/storage/docs/reference-uris.
334 # NOTE: Cloud Storage object versioning is not supported.
335 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
336 # declarations, banners) should be handled for this document. If not
337 # specified, boilerplate will be treated the same as content.
338 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
339 # returns an `INVALID_ARGUMENT` error.
340 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
341 # Cloud audit logging exempt since it is based on user data.
342 &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 -0400343 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700344 # accepted.&lt;br&gt;
345 # [Language
346 # Support](https://cloud.google.com/natural-language/docs/languages) lists
347 # currently supported languages for each API method. If the language (either
348 # specified by the caller or automatically detected) is not supported by the
349 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700350 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
Dan O'Mearadd494642020-05-01 07:42:23 -0700351 # fetching the content, but as a hint for analyzing the document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400352 },
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.
370 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
371 &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;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400380 # (positive sentiment).
Bu Sun Kim65020912020-05-20 12:08:20 -0700381 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400382 # the absolute magnitude of sentiment regardless of score (positive or
383 # negative).
384 },
385 },
386 ],
Bu Sun Kim65020912020-05-20 12:08:20 -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;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
391 # (positive sentiment).
392 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
393 # the absolute magnitude of sentiment regardless of score (positive or
394 # negative).
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 Kim65020912020-05-20 12:08:20 -0700414 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
415 # This URI must be of the form: gs://bucket_name/object_name. For more
416 # details, see https://cloud.google.com/storage/docs/reference-uris.
417 # NOTE: Cloud Storage object versioning is not supported.
418 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
419 # declarations, banners) should be handled for this document. If not
420 # specified, boilerplate will be treated the same as content.
421 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
422 # returns an `INVALID_ARGUMENT` error.
423 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
424 # Cloud audit logging exempt since it is based on user data.
425 &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 -0400426 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700427 # accepted.&lt;br&gt;
428 # [Language
429 # Support](https://cloud.google.com/natural-language/docs/languages) lists
430 # currently supported languages for each API method. If the language (either
431 # specified by the caller or automatically detected) is not supported by the
432 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700433 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
Dan O'Mearadd494642020-05-01 07:42:23 -0700434 # fetching the content, but as a hint for analyzing the document.
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;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 -0400448 # in the request or, if not specified, the automatically-detected language.
449 # See Document.language field for more details.
Bu Sun Kim65020912020-05-20 12:08:20 -0700450 &quot;sentences&quot;: [ # Sentences in the input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400451 { # Represents a sentence in the input document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700452 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
453 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
454 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400455 # document according to the EncodingType specified in the API request.
456 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700457 &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 -0400458 # AnnotateTextRequest.Features.extract_document_sentiment is set to
459 # true, this field will contain the sentiment for the sentence.
460 # the text.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700461 # Next ID: 6
Bu Sun Kim65020912020-05-20 12:08:20 -0700462 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400463 # (positive sentiment).
Bu Sun Kim65020912020-05-20 12:08:20 -0700464 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400465 # the absolute magnitude of sentiment regardless of score (positive or
466 # negative).
467 },
468 },
469 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700470 &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
471 { # Represents the smallest syntactic building block of the text.
472 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
473 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
474 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
475 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
476 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
477 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
478 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
479 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
480 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
481 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
482 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
483 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
484 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
485 },
486 &quot;text&quot;: { # Represents an output piece of text. # The token text.
487 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
488 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
489 # document according to the EncodingType specified in the API request.
490 },
491 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
492 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
493 # This is the index of the token which has an arc going to this token.
494 # The index is the position of the token in the array of tokens returned
495 # by the API method. If this token is a root token, then the
496 # `head_token_index` is its own index.
497 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
498 },
499 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
500 },
501 ],
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;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
517 &quot;document&quot;: { # ################################################################ # # Required. Input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400518 #
519 # Represents the input to API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -0700520 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
521 # This URI must be of the form: gs://bucket_name/object_name. For more
522 # details, see https://cloud.google.com/storage/docs/reference-uris.
523 # NOTE: Cloud Storage object versioning is not supported.
524 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
525 # declarations, banners) should be handled for this document. If not
526 # specified, boilerplate will be treated the same as content.
527 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
528 # returns an `INVALID_ARGUMENT` error.
529 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
530 # Cloud audit logging exempt since it is based on user data.
531 &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 -0400532 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700533 # accepted.&lt;br&gt;
534 # [Language
535 # Support](https://cloud.google.com/natural-language/docs/languages) lists
536 # currently supported languages for each API method. If the language (either
537 # specified by the caller or automatically detected) is not supported by the
538 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700539 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
Dan O'Mearadd494642020-05-01 07:42:23 -0700540 # fetching the content, but as a hint for analyzing the document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400541 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700542 &quot;features&quot;: { # All available features for sentiment, syntax, and semantic analysis. # Required. The enabled features.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400543 # Setting each one to true will enable that specific analysis for the input.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700544 # Next ID: 10
Bu Sun Kim65020912020-05-20 12:08:20 -0700545 &quot;extractEntities&quot;: True or False, # Extract entities.
546 &quot;classifyText&quot;: True or False, # Classify the full document into categories. If this is true,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700547 # the API will use the default model which classifies into a
Dan O'Mearadd494642020-05-01 07:42:23 -0700548 # [predefined
549 # taxonomy](https://cloud.google.com/natural-language/docs/categories).
Bu Sun Kim65020912020-05-20 12:08:20 -0700550 &quot;extractSyntax&quot;: True or False, # Extract syntax information.
551 &quot;extractDocumentSentiment&quot;: True or False, # Extract document-level sentiment.
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;sentences&quot;: [ # Sentences in the input document. Populated if the user enables
566 # AnnotateTextRequest.Features.extract_syntax.
567 { # Represents a sentence in the input document.
568 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
569 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
570 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
571 # document according to the EncodingType specified in the API request.
572 },
573 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
574 # AnnotateTextRequest.Features.extract_document_sentiment is set to
575 # true, this field will contain the sentiment for the sentence.
576 # the text.
577 # Next ID: 6
578 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
579 # (positive sentiment).
580 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
581 # the absolute magnitude of sentiment regardless of score (positive or
582 # negative).
583 },
584 },
585 ],
586 &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400587 # Populated if the user enables
588 # AnnotateTextRequest.Features.extract_syntax.
589 { # Represents the smallest syntactic building block of the text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700590 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
591 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
592 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
593 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
594 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
595 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
596 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
597 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
598 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
599 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
600 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
601 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
602 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
603 },
604 &quot;text&quot;: { # Represents an output piece of text. # The token text.
605 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
606 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Dan O'Mearadd494642020-05-01 07:42:23 -0700607 # document according to the EncodingType specified in the API request.
608 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700609 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
610 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400611 # This is the index of the token which has an arc going to this token.
612 # The index is the position of the token in the array of tokens returned
613 # by the API method. If this token is a root token, then the
614 # `head_token_index` is its own index.
Bu Sun Kim65020912020-05-20 12:08:20 -0700615 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400616 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700617 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400618 },
619 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700620 &quot;categories&quot;: [ # Categories identified in the input document.
621 { # Represents a category returned from the text classifier.
622 &quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document, from the [predefined
623 # taxonomy](https://cloud.google.com/natural-language/docs/categories).
624 &quot;confidence&quot;: 3.14, # The classifier&#x27;s confidence of the category. Number represents how certain
625 # the classifier is that this category represents the given text.
626 },
627 ],
628 &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
629 # AnnotateTextRequest.Features.extract_document_sentiment.
630 # the text.
631 # Next ID: 6
632 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
633 # (positive sentiment).
634 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
635 # the absolute magnitude of sentiment regardless of score (positive or
636 # negative).
637 },
638 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
639 # in the request or, if not specified, the automatically-detected language.
640 # See Document.language field for more details.
641 &quot;entities&quot;: [ # Entities, along with their semantic information, in the input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400642 # Populated if the user enables
643 # AnnotateTextRequest.Features.extract_entities.
644 { # Represents a phrase in the text that is a known entity, such as
645 # a person, an organization, or location. The API associates information, such
646 # as salience and mentions, with entities.
Bu Sun Kim65020912020-05-20 12:08:20 -0700647 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
648 &quot;type&quot;: &quot;A String&quot;, # The entity type.
649 &quot;metadata&quot;: { # Metadata associated with the entity.
650 #
651 # For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
652 # and Knowledge Graph MID (`mid`), if they are available. For the metadata
653 # associated with other entity types, see the Type table below.
654 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400655 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700656 &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 -0400657 #
658 # The salience score for an entity provides information about the
659 # importance or centrality of that entity to the entire document text.
660 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
661 # salient.
Bu Sun Kim65020912020-05-20 12:08:20 -0700662 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
663 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
664 # true, this field will contain the aggregate sentiment expressed for this
665 # entity in the provided document.
666 # the text.
667 # Next ID: 6
668 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
669 # (positive sentiment).
670 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
671 # the absolute magnitude of sentiment regardless of score (positive or
672 # negative).
673 },
674 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400675 # supports proper noun mentions.
676 { # Represents a mention for an entity in the text. Currently, proper noun
677 # mentions are supported.
Bu Sun Kim65020912020-05-20 12:08:20 -0700678 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
679 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
680 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400681 # document according to the EncodingType specified in the API request.
682 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700683 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
684 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400685 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
686 # true, this field will contain the sentiment expressed for this mention of
687 # the entity in the provided document.
688 # the text.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700689 # Next ID: 6
Bu Sun Kim65020912020-05-20 12:08:20 -0700690 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400691 # (positive sentiment).
Bu Sun Kim65020912020-05-20 12:08:20 -0700692 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400693 # the absolute magnitude of sentiment regardless of score (positive or
694 # negative).
695 },
696 },
697 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700698 },
699 ],
700 }</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 Kim65020912020-05-20 12:08:20 -0700715 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
716 # This URI must be of the form: gs://bucket_name/object_name. For more
717 # details, see https://cloud.google.com/storage/docs/reference-uris.
718 # NOTE: Cloud Storage object versioning is not supported.
719 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
720 # declarations, banners) should be handled for this document. If not
721 # specified, boilerplate will be treated the same as content.
722 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
723 # returns an `INVALID_ARGUMENT` error.
724 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
725 # Cloud audit logging exempt since it is based on user data.
726 &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 -0700727 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700728 # accepted.&lt;br&gt;
729 # [Language
730 # Support](https://cloud.google.com/natural-language/docs/languages) lists
731 # currently supported languages for each API method. If the language (either
732 # specified by the caller or automatically detected) is not supported by the
733 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700734 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
Dan O'Mearadd494642020-05-01 07:42:23 -0700735 # fetching the content, but as a hint for analyzing the document.
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 Kim65020912020-05-20 12:08:20 -0700750 &quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document, from the [predefined
Dan O'Mearadd494642020-05-01 07:42:23 -0700751 # taxonomy](https://cloud.google.com/natural-language/docs/categories).
Bu Sun Kim65020912020-05-20 12:08:20 -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>