blob: 326d3d60fc8589b59129fd34e52ec8b40104916b [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.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700122 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
123 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700124 &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 -0400125 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700126 # accepted.&lt;br&gt;
127 # [Language
128 # Support](https://cloud.google.com/natural-language/docs/languages) lists
129 # currently supported languages for each API method. If the language (either
130 # specified by the caller or automatically detected) is not supported by the
131 # called API method, an `INVALID_ARGUMENT` error is returned.
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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700183 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400184 # document according to the EncodingType specified in the API request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700185 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400186 },
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.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700232 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
233 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700234 &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 -0400235 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700236 # accepted.&lt;br&gt;
237 # [Language
238 # Support](https://cloud.google.com/natural-language/docs/languages) lists
239 # currently supported languages for each API method. If the language (either
240 # specified by the caller or automatically detected) is not supported by the
241 # called API method, an `INVALID_ARGUMENT` error is returned.
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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700290 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400291 # document according to the EncodingType specified in the API request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700292 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400293 },
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.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700342 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
343 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700344 &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 -0400345 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700346 # accepted.&lt;br&gt;
347 # [Language
348 # Support](https://cloud.google.com/natural-language/docs/languages) lists
349 # currently supported languages for each API method. If the language (either
350 # specified by the caller or automatically detected) is not supported by the
351 # called API method, an `INVALID_ARGUMENT` error is returned.
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 Kim4ed7d3f2020-05-27 12:20:54 -0700364 &quot;documentSentiment&quot;: { # Represents the feeling associated with the entire text or entities in # The overall sentiment of the input document.
365 # the text.
366 # Next ID: 6
367 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
368 # (positive sentiment).
369 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
370 # the absolute magnitude of sentiment regardless of score (positive or
371 # negative).
372 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700373 &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 -0400374 # in the request or, if not specified, the automatically-detected language.
375 # See Document.language field for more details.
Bu Sun Kim65020912020-05-20 12:08:20 -0700376 &quot;sentences&quot;: [ # The sentiment for all the sentences in the document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400377 { # Represents a sentence in the input document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700378 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700379 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400380 # document according to the EncodingType specified in the API request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700381 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400382 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700383 &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 -0400384 # AnnotateTextRequest.Features.extract_document_sentiment is set to
385 # true, this field will contain the sentiment for the sentence.
386 # the text.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700387 # Next ID: 6
Bu Sun Kim65020912020-05-20 12:08:20 -0700388 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400389 # (positive sentiment).
Bu Sun Kim65020912020-05-20 12:08:20 -0700390 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400391 # the absolute magnitude of sentiment regardless of score (positive or
392 # negative).
393 },
394 },
395 ],
396 }</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.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700425 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
426 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700427 &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 -0400428 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700429 # accepted.&lt;br&gt;
430 # [Language
431 # Support](https://cloud.google.com/natural-language/docs/languages) lists
432 # currently supported languages for each API method. If the language (either
433 # specified by the caller or automatically detected) is not supported by the
434 # called API method, an `INVALID_ARGUMENT` error is returned.
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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700453 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400454 # document according to the EncodingType specified in the API request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700455 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400456 },
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.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700472 &quot;text&quot;: { # Represents an output piece of text. # The token text.
473 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
474 # document according to the EncodingType specified in the API request.
475 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
476 },
477 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
478 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
479 # This is the index of the token which has an arc going to this token.
480 # The index is the position of the token in the array of tokens returned
481 # by the API method. If this token is a root token, then the
482 # `head_token_index` is its own index.
483 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
484 },
485 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
Bu Sun Kim65020912020-05-20 12:08:20 -0700486 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
487 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
488 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
489 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
490 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
491 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
492 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
493 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
494 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
495 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
496 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
497 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
498 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
499 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700500 },
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 Kim4ed7d3f2020-05-27 12:20:54 -0700516 &quot;features&quot;: { # All available features for sentiment, syntax, and semantic analysis. # Required. The enabled features.
517 # Setting each one to true will enable that specific analysis for the input.
518 # Next ID: 10
519 &quot;extractEntities&quot;: True or False, # Extract entities.
520 &quot;classifyText&quot;: True or False, # Classify the full document into categories. If this is true,
521 # the API will use the default model which classifies into a
522 # [predefined
523 # taxonomy](https://cloud.google.com/natural-language/docs/categories).
524 &quot;extractSyntax&quot;: True or False, # Extract syntax information.
525 &quot;extractDocumentSentiment&quot;: True or False, # Extract document-level sentiment.
526 &quot;extractEntitySentiment&quot;: True or False, # Extract entities and their associated sentiment.
527 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700528 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
529 &quot;document&quot;: { # ################################################################ # # Required. Input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400530 #
531 # Represents the input to API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -0700532 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
533 # This URI must be of the form: gs://bucket_name/object_name. For more
534 # details, see https://cloud.google.com/storage/docs/reference-uris.
535 # NOTE: Cloud Storage object versioning is not supported.
536 &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright
537 # declarations, banners) should be handled for this document. If not
538 # specified, boilerplate will be treated the same as content.
539 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
540 # returns an `INVALID_ARGUMENT` error.
541 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
542 # Cloud audit logging exempt since it is based on user data.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700543 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
544 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700545 &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 -0400546 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700547 # accepted.&lt;br&gt;
548 # [Language
549 # Support](https://cloud.google.com/natural-language/docs/languages) lists
550 # currently supported languages for each API method. If the language (either
551 # specified by the caller or automatically detected) is not supported by the
552 # called API method, an `INVALID_ARGUMENT` error is returned.
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;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400566 # Populated if the user enables
567 # AnnotateTextRequest.Features.extract_syntax.
568 { # Represents the smallest syntactic building block of the text.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700569 &quot;text&quot;: { # Represents an output piece of text. # The token 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 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
573 },
574 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
575 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
576 # This is the index of the token which has an arc going to this token.
577 # The index is the position of the token in the array of tokens returned
578 # by the API method. If this token is a root token, then the
579 # `head_token_index` is its own index.
580 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
581 },
582 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
Bu Sun Kim65020912020-05-20 12:08:20 -0700583 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
584 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
585 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
586 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
587 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
588 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
589 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
590 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
591 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
592 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
593 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
594 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
595 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
596 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400597 },
598 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700599 &quot;categories&quot;: [ # Categories identified in the input document.
600 { # Represents a category returned from the text classifier.
Bu Sun Kim65020912020-05-20 12:08:20 -0700601 &quot;confidence&quot;: 3.14, # The classifier&#x27;s confidence of the category. Number represents how certain
602 # the classifier is that this category represents the given text.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700603 &quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document, from the [predefined
604 # taxonomy](https://cloud.google.com/natural-language/docs/categories).
Bu Sun Kim65020912020-05-20 12:08:20 -0700605 },
606 ],
607 &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
608 # AnnotateTextRequest.Features.extract_document_sentiment.
609 # the text.
610 # Next ID: 6
611 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
612 # (positive sentiment).
613 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
614 # the absolute magnitude of sentiment regardless of score (positive or
615 # negative).
616 },
617 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
618 # in the request or, if not specified, the automatically-detected language.
619 # See Document.language field for more details.
620 &quot;entities&quot;: [ # Entities, along with their semantic information, in the input document.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400621 # Populated if the user enables
622 # AnnotateTextRequest.Features.extract_entities.
623 { # Represents a phrase in the text that is a known entity, such as
624 # a person, an organization, or location. The API associates information, such
625 # as salience and mentions, with entities.
Bu Sun Kim65020912020-05-20 12:08:20 -0700626 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
627 &quot;type&quot;: &quot;A String&quot;, # The entity type.
628 &quot;metadata&quot;: { # Metadata associated with the entity.
629 #
630 # For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
631 # and Knowledge Graph MID (`mid`), if they are available. For the metadata
632 # associated with other entity types, see the Type table below.
633 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400634 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700635 &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 -0400636 #
637 # The salience score for an entity provides information about the
638 # importance or centrality of that entity to the entire document text.
639 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
640 # salient.
Bu Sun Kim65020912020-05-20 12:08:20 -0700641 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if
642 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
643 # true, this field will contain the aggregate sentiment expressed for this
644 # entity in the provided document.
645 # the text.
646 # Next ID: 6
647 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
648 # (positive sentiment).
649 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
650 # the absolute magnitude of sentiment regardless of score (positive or
651 # negative).
652 },
653 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400654 # supports proper noun mentions.
655 { # Represents a mention for an entity in the text. Currently, proper noun
656 # mentions are supported.
Bu Sun Kim65020912020-05-20 12:08:20 -0700657 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700658 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400659 # document according to the EncodingType specified in the API request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700660 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400661 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700662 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
663 &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 -0400664 # AnnotateTextRequest.Features.extract_entity_sentiment is set to
665 # true, this field will contain the sentiment expressed for this mention of
666 # the entity in the provided document.
667 # the text.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700668 # Next ID: 6
Bu Sun Kim65020912020-05-20 12:08:20 -0700669 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400670 # (positive sentiment).
Bu Sun Kim65020912020-05-20 12:08:20 -0700671 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400672 # the absolute magnitude of sentiment regardless of score (positive or
673 # negative).
674 },
675 },
676 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700677 },
678 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700679 &quot;sentences&quot;: [ # Sentences in the input document. Populated if the user enables
680 # AnnotateTextRequest.Features.extract_syntax.
681 { # Represents a sentence in the input document.
682 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
683 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
684 # document according to the EncodingType specified in the API request.
685 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
686 },
687 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
688 # AnnotateTextRequest.Features.extract_document_sentiment is set to
689 # true, this field will contain the sentiment for the sentence.
690 # the text.
691 # Next ID: 6
692 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
693 # (positive sentiment).
694 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
695 # the absolute magnitude of sentiment regardless of score (positive or
696 # negative).
697 },
698 },
699 ],
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 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.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700726 &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for
727 # fetching the content, but as a hint for analyzing the document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700728 &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 -0700729 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700730 # accepted.&lt;br&gt;
731 # [Language
732 # Support](https://cloud.google.com/natural-language/docs/languages) lists
733 # currently supported languages for each API method. If the language (either
734 # specified by the caller or automatically detected) is not supported by the
735 # called API method, an `INVALID_ARGUMENT` error is returned.
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;confidence&quot;: 3.14, # The classifier&#x27;s confidence of the category. Number represents how certain
751 # the classifier is that this category represents the given text.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700752 &quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document, from the [predefined
753 # taxonomy](https://cloud.google.com/natural-language/docs/categories).
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>