blob: baa6810b0e5a1d8d068ac51e8d941d00a8110d00 [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;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700106 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700107 # accepted.&lt;br&gt;
108 # [Language
109 # Support](https://cloud.google.com/natural-language/docs/languages) lists
110 # currently supported languages for each API method. If the language (either
111 # specified by the caller or automatically detected) is not supported by the
112 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700113 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
114 # returns an `INVALID_ARGUMENT` error.
115 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
116 # Cloud audit logging exempt since it is based on user data.
117 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800118 # 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;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
134 # in the request or, if not specified, the automatically-detected language.
135 # See Document.language field for more details.
136 &quot;entities&quot;: [ # The recognized entities in the input document.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700137 { # Represents a phrase in the text that is a known entity, such as
138 # a person, an organization, or location. The API associates information, such
139 # as salience and mentions, with entities.
Bu Sun Kim65020912020-05-20 12:08:20 -0700140 &quot;type&quot;: &quot;A String&quot;, # The entity type.
141 &quot;metadata&quot;: { # Metadata associated with the entity.
142 #
143 # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
144 # available. The associated keys are &quot;wikipedia_url&quot; and &quot;mid&quot;, respectively.
145 &quot;a_key&quot;: &quot;A String&quot;,
146 },
147 &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 -0700148 #
149 # The salience score for an entity provides information about the
150 # importance or centrality of that entity to the entire document text.
151 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
152 # salient.
Bu Sun Kim65020912020-05-20 12:08:20 -0700153 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
154 # supports proper noun mentions.
155 { # Represents a mention for an entity in the text. Currently, proper noun
156 # mentions are supported.
157 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
158 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
159 # document according to the EncodingType specified in the API request.
160 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
161 },
162 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
163 },
164 ],
165 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700166 },
167 ],
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;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700186 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700187 # accepted.&lt;br&gt;
188 # [Language
189 # Support](https://cloud.google.com/natural-language/docs/languages) lists
190 # currently supported languages for each API method. If the language (either
191 # specified by the caller or automatically detected) is not supported by the
192 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700193 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
194 # returns an `INVALID_ARGUMENT` error.
195 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
196 # Cloud audit logging exempt since it is based on user data.
197 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800198 # 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;documentSentiment&quot;: { # Represents the feeling associated with the entire text or entities in # The overall sentiment of the input document.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700214 # the text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700215 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800216 # favor of score. Please refer to our documentation at
217 # https://cloud.google.com/natural-language/docs for more information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700218 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400219 # (positive sentiment).
Bu Sun Kim65020912020-05-20 12:08:20 -0700220 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800221 # the absolute magnitude of sentiment regardless of score (positive or
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700222 # negative).
223 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700224 &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 -0700225 # in the request or, if not specified, the automatically-detected language.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400226 # See Document.language field for more details.
Bu Sun Kim65020912020-05-20 12:08:20 -0700227 &quot;sentences&quot;: [ # The sentiment for all the sentences in the document.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800228 { # Represents a sentence in the input document.
Bu Sun Kim65020912020-05-20 12:08:20 -0700229 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
230 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800231 # document according to the EncodingType specified in the API request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700232 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800233 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700234 &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 -0800235 # AnnotateTextRequest.Features.extract_document_sentiment is set to
236 # true, this field will contain the sentiment for the sentence.
237 # the text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700238 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800239 # favor of score. Please refer to our documentation at
240 # https://cloud.google.com/natural-language/docs for more information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700241 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400242 # (positive sentiment).
Bu Sun Kim65020912020-05-20 12:08:20 -0700243 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800244 # the absolute magnitude of sentiment regardless of score (positive or
245 # negative).
246 },
247 },
248 ],
249 }</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;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800268 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700269 # accepted.&lt;br&gt;
270 # [Language
271 # Support](https://cloud.google.com/natural-language/docs/languages) lists
272 # currently supported languages for each API method. If the language (either
273 # specified by the caller or automatically detected) is not supported by the
274 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700275 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
276 # returns an `INVALID_ARGUMENT` error.
277 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
278 # Cloud audit logging exempt since it is based on user data.
279 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800280 # 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.
283 },
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 Kim65020912020-05-20 12:08:20 -0700295 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
296 # in the request or, if not specified, the automatically-detected language.
297 # See Document.language field for more details.
298 &quot;sentences&quot;: [ # Sentences in the input document.
299 { # Represents a sentence in the input document.
300 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
301 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400302 # document according to the EncodingType specified in the API request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700303 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800304 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700305 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
306 # AnnotateTextRequest.Features.extract_document_sentiment is set to
307 # true, this field will contain the sentiment for the sentence.
308 # the text.
309 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
310 # favor of score. Please refer to our documentation at
311 # https://cloud.google.com/natural-language/docs for more information.
312 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
313 # (positive sentiment).
314 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
315 # the absolute magnitude of sentiment regardless of score (positive or
316 # negative).
317 },
318 },
319 ],
320 &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
321 { # Represents the smallest syntactic building block of the text.
322 &quot;text&quot;: { # Represents an output piece of text. # The token text.
323 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
324 # document according to the EncodingType specified in the API request.
325 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
326 },
327 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
328 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400329 # This is the index of the token which has an arc going to this token.
330 # The index is the position of the token in the array of tokens returned
331 # by the API method. If this token is a root token, then the
332 # `head_token_index` is its own index.
Bu Sun Kim65020912020-05-20 12:08:20 -0700333 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
Thomas Coffee2f245372017-03-27 10:39:26 -0700334 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700335 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
336 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
337 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
338 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
339 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
340 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
341 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
342 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
343 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
344 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
345 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
346 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
347 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
348 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800349 },
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.
367 &quot;document&quot;: { # ################################################################ # # Input document.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700368 #
369 # Represents the input to API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -0700370 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700371 # automatically detected). Both ISO and BCP-47 language codes are
Dan O'Mearadd494642020-05-01 07:42:23 -0700372 # accepted.&lt;br&gt;
373 # [Language
374 # Support](https://cloud.google.com/natural-language/docs/languages) lists
375 # currently supported languages for each API method. If the language (either
376 # specified by the caller or automatically detected) is not supported by the
377 # called API method, an `INVALID_ARGUMENT` error is returned.
Bu Sun Kim65020912020-05-20 12:08:20 -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.
380 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
381 # Cloud audit logging exempt since it is based on user data.
382 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800383 # This URI must be of the form: gs://bucket_name/object_name. For more
384 # details, see https://cloud.google.com/storage/docs/reference-uris.
385 # NOTE: Cloud Storage object versioning is not supported.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700386 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700387 &quot;features&quot;: { # All available features for sentiment, syntax, and semantic analysis. # The enabled features.
Dan O'Mearadd494642020-05-01 07:42:23 -0700388 # Setting each one to true will enable that specific analysis for the input.
Bu Sun Kim65020912020-05-20 12:08:20 -0700389 &quot;extractEntities&quot;: True or False, # Extract entities.
390 &quot;extractSyntax&quot;: True or False, # Extract syntax information.
391 &quot;extractDocumentSentiment&quot;: True or False, # Extract document-level sentiment.
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 Kim65020912020-05-20 12:08:20 -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;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
411 # (positive sentiment).
412 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
413 # the absolute magnitude of sentiment regardless of score (positive or
414 # negative).
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.
419 &quot;sentences&quot;: [ # Sentences in the input document. Populated if the user enables
420 # AnnotateTextRequest.Features.extract_syntax.
421 { # Represents a sentence in the input document.
422 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
423 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
424 # document according to the EncodingType specified in the API request.
425 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
426 },
427 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
428 # AnnotateTextRequest.Features.extract_document_sentiment is set to
429 # true, this field will contain the sentiment for the sentence.
430 # the text.
431 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
432 # favor of score. Please refer to our documentation at
433 # https://cloud.google.com/natural-language/docs for more information.
434 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
435 # (positive sentiment).
436 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
437 # the absolute magnitude of sentiment regardless of score (positive or
438 # negative).
439 },
440 },
441 ],
442 &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700443 # Populated if the user enables
444 # AnnotateTextRequest.Features.extract_syntax.
445 { # Represents the smallest syntactic building block of the text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700446 &quot;text&quot;: { # Represents an output piece of text. # The token text.
447 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400448 # document according to the EncodingType specified in the API request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700449 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700450 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700451 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
452 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400453 # This is the index of the token which has an arc going to this token.
454 # The index is the position of the token in the array of tokens returned
455 # by the API method. If this token is a root token, then the
456 # `head_token_index` is its own index.
Bu Sun Kim65020912020-05-20 12:08:20 -0700457 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
Thomas Coffee2f245372017-03-27 10:39:26 -0700458 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700459 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
460 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
461 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
462 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
463 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
464 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
465 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
466 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
467 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
468 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
469 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
470 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
471 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
472 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
Dan O'Mearadd494642020-05-01 07:42:23 -0700473 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700474 },
475 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700476 &quot;entities&quot;: [ # Entities, along with their semantic information, in the input document.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700477 # Populated if the user enables
478 # AnnotateTextRequest.Features.extract_entities.
479 { # Represents a phrase in the text that is a known entity, such as
480 # a person, an organization, or location. The API associates information, such
481 # as salience and mentions, with entities.
Bu Sun Kim65020912020-05-20 12:08:20 -0700482 &quot;type&quot;: &quot;A String&quot;, # The entity type.
483 &quot;metadata&quot;: { # Metadata associated with the entity.
484 #
485 # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
486 # available. The associated keys are &quot;wikipedia_url&quot; and &quot;mid&quot;, respectively.
487 &quot;a_key&quot;: &quot;A String&quot;,
488 },
489 &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 -0700490 #
491 # The salience score for an entity provides information about the
492 # importance or centrality of that entity to the entire document text.
493 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
494 # salient.
Bu Sun Kim65020912020-05-20 12:08:20 -0700495 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
496 # supports proper noun mentions.
497 { # Represents a mention for an entity in the text. Currently, proper noun
498 # mentions are supported.
499 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
500 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
501 # document according to the EncodingType specified in the API request.
502 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
503 },
504 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
505 },
506 ],
507 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700508 },
509 ],
510 }</pre>
511</div>
512
513</body></html>