blob: 38feb174cb0050c8242e79df5c60d227f3963f41 [file] [log] [blame]
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001<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_v1beta1.html">Cloud Natural Language API</a> . <a href="language_v1beta1.documents.html">documents</a></h1>
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070076<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 Cheemalapatie833b792017-03-24 15:06:46 -070079<p class="firstline">Finds named entities (currently proper names and common nouns) in the text</p>
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070080<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#analyzeSentiment">analyzeSentiment(body=None, x__xgafv=None)</a></code></p>
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070082<p class="firstline">Analyzes the sentiment of the provided text.</p>
83<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070084 <code><a href="#analyzeSyntax">analyzeSyntax(body=None, x__xgafv=None)</a></code></p>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -080085<p class="firstline">Analyzes the syntax of the text and provides sentence boundaries and</p>
86<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#annotateText">annotateText(body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -070088<p class="firstline">A convenience method that provides all the features that analyzeSentiment,</p>
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070089<h3>Method Details</h3>
90<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070091 <code class="details" id="analyzeEntities">analyzeEntities(body=None, x__xgafv=None)</code>
Sai Cheemalapatie833b792017-03-24 15:06:46 -070092 <pre>Finds named entities (currently proper names and common nouns) in the text
93along with entity types, salience, mentions for each entity, and
94other properties.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070095
96Args:
Dan O'Mearadd494642020-05-01 07:42:23 -070097 body: object, The request body.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070098 The object takes the form of:
99
100{ # The entity analysis request message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700101 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
102 &quot;document&quot;: { # ################################################################ # # Input document.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700103 #
104 # Represents the input to API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -0700105 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
106 # Cloud audit logging exempt since it is based on user data.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700107 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
108 # returns an `INVALID_ARGUMENT` error.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700109 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
110 # automatically detected). Both ISO and BCP-47 language codes are
111 # accepted.&lt;br&gt;
112 # [Language
113 # Support](https://cloud.google.com/natural-language/docs/languages) lists
114 # currently supported languages for each API method. If the language (either
115 # specified by the caller or automatically detected) is not supported by the
116 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700117 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
118 # This URI must be of the form: gs://bucket_name/object_name. For more
119 # details, see https://cloud.google.com/storage/docs/reference-uris.
120 # NOTE: Cloud Storage object versioning is not supported.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700121 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700122 }
123
124 x__xgafv: string, V1 error format.
125 Allowed values
126 1 - v1 error format
127 2 - v2 error format
128
129Returns:
130 An object of the form:
131
132 { # The entity analysis response message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700133 &quot;entities&quot;: [ # The recognized entities in the input document.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700134 { # Represents a phrase in the text that is a known entity, such as
135 # a person, an organization, or location. The API associates information, such
136 # as salience and mentions, with entities.
Bu Sun Kim65020912020-05-20 12:08:20 -0700137 &quot;salience&quot;: 3.14, # The salience score associated with the entity in the [0, 1.0] range.
Dan O'Mearadd494642020-05-01 07:42:23 -0700138 #
139 # The salience score for an entity provides information about the
140 # importance or centrality of that entity to the entire document text.
141 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
142 # salient.
Bu Sun Kim65020912020-05-20 12:08:20 -0700143 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
144 # supports proper noun mentions.
145 { # Represents a mention for an entity in the text. Currently, proper noun
146 # mentions are supported.
147 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700148 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700149 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
150 # document according to the EncodingType specified in the API request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700151 },
152 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
153 },
154 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700155 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
156 &quot;type&quot;: &quot;A String&quot;, # The entity type.
157 &quot;metadata&quot;: { # Metadata associated with the entity.
158 #
159 # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
160 # available. The associated keys are &quot;wikipedia_url&quot; and &quot;mid&quot;, respectively.
161 &quot;a_key&quot;: &quot;A String&quot;,
162 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700163 },
164 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700165 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
166 # in the request or, if not specified, the automatically-detected language.
167 # See Document.language field for more details.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700168 }</pre>
169</div>
170
171<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700172 <code class="details" id="analyzeSentiment">analyzeSentiment(body=None, x__xgafv=None)</code>
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700173 <pre>Analyzes the sentiment of the provided text.
174
175Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700176 body: object, The request body.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700177 The object takes the form of:
178
179{ # The sentiment analysis request message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700180 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate sentence offsets for the
Thomas Coffee2f245372017-03-27 10:39:26 -0700181 # sentence sentiment.
Bu Sun Kim65020912020-05-20 12:08:20 -0700182 &quot;document&quot;: { # ################################################################ # # Input document.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700183 #
184 # Represents the input to API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -0700185 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
186 # Cloud audit logging exempt since it is based on user data.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700187 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
188 # returns an `INVALID_ARGUMENT` error.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700189 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
190 # automatically detected). Both ISO and BCP-47 language codes are
191 # accepted.&lt;br&gt;
192 # [Language
193 # Support](https://cloud.google.com/natural-language/docs/languages) lists
194 # currently supported languages for each API method. If the language (either
195 # specified by the caller or automatically detected) is not supported by the
196 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700197 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
198 # This URI must be of the form: gs://bucket_name/object_name. For more
199 # details, see https://cloud.google.com/storage/docs/reference-uris.
200 # NOTE: Cloud Storage object versioning is not supported.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700201 },
202 }
203
204 x__xgafv: string, V1 error format.
205 Allowed values
206 1 - v1 error format
207 2 - v2 error format
208
209Returns:
210 An object of the form:
211
212 { # The sentiment analysis response message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700213 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700214 # in the request or, if not specified, the automatically-detected language.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400215 # See Document.language field for more details.
Bu Sun Kim65020912020-05-20 12:08:20 -0700216 &quot;sentences&quot;: [ # The sentiment for all the sentences in the document.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800217 { # Represents a sentence in the input document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700218 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800219 # AnnotateTextRequest.Features.extract_document_sentiment is set to
220 # true, this field will contain the sentiment for the sentence.
221 # the text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700222 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800223 # favor of score. Please refer to our documentation at
224 # https://cloud.google.com/natural-language/docs for more information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700225 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800226 # the absolute magnitude of sentiment regardless of score (positive or
227 # negative).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700228 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
229 # (positive sentiment).
230 },
231 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
232 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
233 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
234 # document according to the EncodingType specified in the API request.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800235 },
236 },
237 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700238 &quot;documentSentiment&quot;: { # Represents the feeling associated with the entire text or entities in # The overall sentiment of the input document.
239 # the text.
240 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
241 # favor of score. Please refer to our documentation at
242 # https://cloud.google.com/natural-language/docs for more information.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700243 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
244 # the absolute magnitude of sentiment regardless of score (positive or
245 # negative).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700246 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
247 # (positive sentiment).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700248 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800249 }</pre>
250</div>
251
252<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700253 <code class="details" id="analyzeSyntax">analyzeSyntax(body=None, x__xgafv=None)</code>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800254 <pre>Analyzes the syntax of the text and provides sentence boundaries and
255tokenization along with part of speech tags, dependency trees, and other
256properties.
257
258Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700259 body: object, The request body.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800260 The object takes the form of:
261
262{ # The syntax analysis request message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700263 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
264 &quot;document&quot;: { # ################################################################ # # Input document.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800265 #
266 # Represents the input to API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -0700267 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
268 # Cloud audit logging exempt since it is based on user data.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700269 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
270 # returns an `INVALID_ARGUMENT` error.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700271 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
272 # automatically detected). Both ISO and BCP-47 language codes are
273 # accepted.&lt;br&gt;
274 # [Language
275 # Support](https://cloud.google.com/natural-language/docs/languages) lists
276 # currently supported languages for each API method. If the language (either
277 # specified by the caller or automatically detected) is not supported by the
278 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700279 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
280 # This URI must be of the form: gs://bucket_name/object_name. For more
281 # details, see https://cloud.google.com/storage/docs/reference-uris.
282 # NOTE: Cloud Storage object versioning is not supported.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800283 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800284 }
285
286 x__xgafv: string, V1 error format.
287 Allowed values
288 1 - v1 error format
289 2 - v2 error format
290
291Returns:
292 An object of the form:
293
294 { # The syntax analysis response message.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700295 &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
296 { # Represents the smallest syntactic building block of the text.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700297 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700298 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
299 # This is the index of the token which has an arc going to this token.
300 # The index is the position of the token in the array of tokens returned
301 # by the API method. If this token is a root token, then the
302 # `head_token_index` is its own index.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700303 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
304 },
305 &quot;text&quot;: { # Represents an output piece of text. # The token text.
306 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
307 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
308 # document according to the EncodingType specified in the API request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700309 },
310 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700311 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
312 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
313 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
314 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
315 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
316 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
317 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
318 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
319 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
320 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
321 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
322 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
323 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
324 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700325 },
326 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700327 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
328 # in the request or, if not specified, the automatically-detected language.
329 # See Document.language field for more details.
330 &quot;sentences&quot;: [ # Sentences in the input document.
331 { # Represents a sentence in the input document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700332 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
333 # AnnotateTextRequest.Features.extract_document_sentiment is set to
334 # true, this field will contain the sentiment for the sentence.
335 # the text.
336 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
337 # favor of score. Please refer to our documentation at
338 # https://cloud.google.com/natural-language/docs for more information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700339 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
340 # the absolute magnitude of sentiment regardless of score (positive or
341 # negative).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700342 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
343 # (positive sentiment).
344 },
345 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
346 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
347 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
348 # document according to the EncodingType specified in the API request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700349 },
350 },
351 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700352 }</pre>
353</div>
354
355<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700356 <code class="details" id="annotateText">annotateText(body=None, x__xgafv=None)</code>
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700357 <pre>A convenience method that provides all the features that analyzeSentiment,
358analyzeEntities, and analyzeSyntax provide in one call.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700359
360Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700361 body: object, The request body.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700362 The object takes the form of:
363
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700364{ # The request message for the text annotation API, which can perform multiple
365 # analysis types (sentiment, entities, and syntax) in one call.
Bu Sun Kim65020912020-05-20 12:08:20 -0700366 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700367 &quot;features&quot;: { # All available features for sentiment, syntax, and semantic analysis. # The enabled features.
368 # Setting each one to true will enable that specific analysis for the input.
369 &quot;extractSyntax&quot;: True or False, # Extract syntax information.
370 &quot;extractDocumentSentiment&quot;: True or False, # Extract document-level sentiment.
371 &quot;extractEntities&quot;: True or False, # Extract entities.
372 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700373 &quot;document&quot;: { # ################################################################ # # Input document.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700374 #
375 # Represents the input to API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -0700376 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
377 # Cloud audit logging exempt since it is based on user data.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700378 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
379 # returns an `INVALID_ARGUMENT` error.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700380 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
381 # automatically detected). Both ISO and BCP-47 language codes are
382 # accepted.&lt;br&gt;
383 # [Language
384 # Support](https://cloud.google.com/natural-language/docs/languages) lists
385 # currently supported languages for each API method. If the language (either
386 # specified by the caller or automatically detected) is not supported by the
387 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700388 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
389 # This URI must be of the form: gs://bucket_name/object_name. For more
390 # details, see https://cloud.google.com/storage/docs/reference-uris.
391 # NOTE: Cloud Storage object versioning is not supported.
Dan O'Mearadd494642020-05-01 07:42:23 -0700392 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700393 }
394
395 x__xgafv: string, V1 error format.
396 Allowed values
397 1 - v1 error format
398 2 - v2 error format
399
400Returns:
401 An object of the form:
402
403 { # The text annotations response message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700404 &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
405 # AnnotateTextRequest.Features.extract_document_sentiment.
406 # the text.
407 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
408 # favor of score. Please refer to our documentation at
409 # https://cloud.google.com/natural-language/docs for more information.
410 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
411 # the absolute magnitude of sentiment regardless of score (positive or
412 # negative).
413 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
414 # (positive sentiment).
415 },
416 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
417 # in the request or, if not specified, the automatically-detected language.
418 # See Document.language field for more details.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700419 &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
420 # Populated if the user enables
421 # AnnotateTextRequest.Features.extract_syntax.
422 { # Represents the smallest syntactic building block of the text.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700423 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700424 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
425 # This is the index of the token which has an arc going to this token.
426 # The index is the position of the token in the array of tokens returned
427 # by the API method. If this token is a root token, then the
428 # `head_token_index` is its own index.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700429 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
430 },
431 &quot;text&quot;: { # Represents an output piece of text. # The token text.
432 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
433 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
434 # document according to the EncodingType specified in the API request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700435 },
436 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700437 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
438 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
439 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
440 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
441 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
442 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
443 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
444 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
445 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
446 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
447 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
448 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
449 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
450 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700451 },
452 ],
453 &quot;entities&quot;: [ # Entities, along with their semantic information, in the input document.
454 # Populated if the user enables
455 # AnnotateTextRequest.Features.extract_entities.
456 { # Represents a phrase in the text that is a known entity, such as
457 # a person, an organization, or location. The API associates information, such
458 # as salience and mentions, with entities.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700459 &quot;salience&quot;: 3.14, # The salience score associated with the entity in the [0, 1.0] range.
460 #
461 # The salience score for an entity provides information about the
462 # importance or centrality of that entity to the entire document text.
463 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
464 # salient.
465 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
466 # supports proper noun mentions.
467 { # Represents a mention for an entity in the text. Currently, proper noun
468 # mentions are supported.
469 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700470 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700471 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
472 # document according to the EncodingType specified in the API request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700473 },
474 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
475 },
476 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700477 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
478 &quot;type&quot;: &quot;A String&quot;, # The entity type.
479 &quot;metadata&quot;: { # Metadata associated with the entity.
480 #
481 # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
482 # available. The associated keys are &quot;wikipedia_url&quot; and &quot;mid&quot;, respectively.
483 &quot;a_key&quot;: &quot;A String&quot;,
484 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700485 },
486 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700487 &quot;sentences&quot;: [ # Sentences in the input document. Populated if the user enables
488 # AnnotateTextRequest.Features.extract_syntax.
489 { # Represents a sentence in the input document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700490 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
491 # AnnotateTextRequest.Features.extract_document_sentiment is set to
492 # true, this field will contain the sentiment for the sentence.
493 # the text.
494 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
495 # favor of score. Please refer to our documentation at
496 # https://cloud.google.com/natural-language/docs for more information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700497 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
498 # the absolute magnitude of sentiment regardless of score (positive or
499 # negative).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700500 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
501 # (positive sentiment).
502 },
503 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
504 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
505 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
506 # document according to the EncodingType specified in the API request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700507 },
508 },
509 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700510 }</pre>
511</div>
512
513</body></html>