blob: e908dc8da5e8b14a7c915a22948602ee5b4324ea [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;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
106 # returns an `INVALID_ARGUMENT` error.
107 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
108 # Cloud audit logging exempt since it is based on user data.
109 &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 -0800110 # This URI must be of the form: gs://bucket_name/object_name. For more
111 # details, see https://cloud.google.com/storage/docs/reference-uris.
112 # NOTE: Cloud Storage object versioning is not supported.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700113 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
114 # automatically detected). Both ISO and BCP-47 language codes are
115 # accepted.&lt;br&gt;
116 # [Language
117 # Support](https://cloud.google.com/natural-language/docs/languages) lists
118 # currently supported languages for each API method. If the language (either
119 # specified by the caller or automatically detected) is not supported by the
120 # called API method, an `INVALID_ARGUMENT` error is returned.
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 Kim4ed7d3f2020-05-27 12:20:54 -0700140 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
Bu Sun Kim65020912020-05-20 12:08:20 -0700141 &quot;type&quot;: &quot;A String&quot;, # The entity type.
142 &quot;metadata&quot;: { # Metadata associated with the entity.
143 #
144 # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
145 # available. The associated keys are &quot;wikipedia_url&quot; and &quot;mid&quot;, respectively.
146 &quot;a_key&quot;: &quot;A String&quot;,
147 },
148 &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 -0700149 #
150 # The salience score for an entity provides information about the
151 # importance or centrality of that entity to the entire document text.
152 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
153 # salient.
Bu Sun Kim65020912020-05-20 12:08:20 -0700154 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
155 # supports proper noun mentions.
156 { # Represents a mention for an entity in the text. Currently, proper noun
157 # mentions are supported.
158 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
159 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
160 # document according to the EncodingType specified in the API request.
161 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
162 },
163 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
164 },
165 ],
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;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
186 # returns an `INVALID_ARGUMENT` error.
187 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
188 # Cloud audit logging exempt since it is based on user data.
189 &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 -0800190 # This URI must be of the form: gs://bucket_name/object_name. For more
191 # details, see https://cloud.google.com/storage/docs/reference-uris.
192 # NOTE: Cloud Storage object versioning is not supported.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700193 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
194 # automatically detected). Both ISO and BCP-47 language codes are
195 # accepted.&lt;br&gt;
196 # [Language
197 # Support](https://cloud.google.com/natural-language/docs/languages) lists
198 # currently supported languages for each API method. If the language (either
199 # specified by the caller or automatically detected) is not supported by the
200 # called API method, an `INVALID_ARGUMENT` error is returned.
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;text&quot;: { # Represents an output piece of text. # The sentence text.
219 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800220 # document according to the EncodingType specified in the API request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700221 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800222 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700223 &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 -0800224 # AnnotateTextRequest.Features.extract_document_sentiment is set to
225 # true, this field will contain the sentiment for the sentence.
226 # the text.
Bu Sun Kim65020912020-05-20 12:08:20 -0700227 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800228 # favor of score. Please refer to our documentation at
229 # https://cloud.google.com/natural-language/docs for more information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700230 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400231 # (positive sentiment).
Bu Sun Kim65020912020-05-20 12:08:20 -0700232 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800233 # the absolute magnitude of sentiment regardless of score (positive or
234 # negative).
235 },
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.
243 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
244 # (positive sentiment).
245 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
246 # the absolute magnitude of sentiment regardless of score (positive or
247 # negative).
248 },
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;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
268 # returns an `INVALID_ARGUMENT` error.
269 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
270 # Cloud audit logging exempt since it is based on user data.
271 &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 -0800272 # This URI must be of the form: gs://bucket_name/object_name. For more
273 # details, see https://cloud.google.com/storage/docs/reference-uris.
274 # NOTE: Cloud Storage object versioning is not supported.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700275 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
276 # automatically detected). Both ISO and BCP-47 language codes are
277 # accepted.&lt;br&gt;
278 # [Language
279 # Support](https://cloud.google.com/natural-language/docs/languages) lists
280 # currently supported languages for each API method. If the language (either
281 # specified by the caller or automatically detected) is not supported by the
282 # called API method, an `INVALID_ARGUMENT` error is returned.
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.
297 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
298 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
299 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
300 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
301 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
302 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
303 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
304 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
305 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
306 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
307 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
308 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
309 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
310 },
311 &quot;text&quot;: { # Represents an output piece of text. # The token text.
312 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
313 # document according to the EncodingType specified in the API request.
314 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
315 },
316 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
317 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
318 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
319 # This is the index of the token which has an arc going to this token.
320 # The index is the position of the token in the array of tokens returned
321 # by the API method. If this token is a root token, then the
322 # `head_token_index` is its own index.
323 },
324 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
325 },
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.
332 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
333 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400334 # document according to the EncodingType specified in the API request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700335 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800336 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700337 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
338 # AnnotateTextRequest.Features.extract_document_sentiment is set to
339 # true, this field will contain the sentiment for the sentence.
340 # the text.
341 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
342 # favor of score. Please refer to our documentation at
343 # https://cloud.google.com/natural-language/docs for more information.
344 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
345 # (positive sentiment).
346 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
347 # the absolute magnitude of sentiment regardless of score (positive or
348 # negative).
349 },
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;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
371 # returns an `INVALID_ARGUMENT` error.
372 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format.
373 # Cloud audit logging exempt since it is based on user data.
374 &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 -0800375 # This URI must be of the form: gs://bucket_name/object_name. For more
376 # details, see https://cloud.google.com/storage/docs/reference-uris.
377 # NOTE: Cloud Storage object versioning is not supported.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700378 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is
379 # automatically detected). Both ISO and BCP-47 language codes are
380 # accepted.&lt;br&gt;
381 # [Language
382 # Support](https://cloud.google.com/natural-language/docs/languages) lists
383 # currently supported languages for each API method. If the language (either
384 # specified by the caller or automatically detected) is not supported by the
385 # called API method, an `INVALID_ARGUMENT` error is returned.
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;extractSyntax&quot;: True or False, # Extract syntax information.
390 &quot;extractDocumentSentiment&quot;: True or False, # Extract document-level sentiment.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700391 &quot;extractEntities&quot;: True or False, # Extract entities.
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 Kim4ed7d3f2020-05-27 12:20:54 -0700404 &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
405 # Populated if the user enables
406 # AnnotateTextRequest.Features.extract_syntax.
407 { # Represents the smallest syntactic building block of the text.
408 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
409 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
410 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
411 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
412 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
413 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
414 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
415 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
416 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
417 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
418 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
419 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
420 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
421 },
422 &quot;text&quot;: { # Represents an output piece of text. # The token 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;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
428 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
429 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree.
430 # This is the index of the token which has an arc going to this token.
431 # The index is the position of the token in the array of tokens returned
432 # by the API method. If this token is a root token, then the
433 # `head_token_index` is its own index.
434 },
435 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
436 },
437 ],
438 &quot;entities&quot;: [ # Entities, along with their semantic information, in the input document.
439 # Populated if the user enables
440 # AnnotateTextRequest.Features.extract_entities.
441 { # Represents a phrase in the text that is a known entity, such as
442 # a person, an organization, or location. The API associates information, such
443 # as salience and mentions, with entities.
444 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
445 &quot;type&quot;: &quot;A String&quot;, # The entity type.
446 &quot;metadata&quot;: { # Metadata associated with the entity.
447 #
448 # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
449 # available. The associated keys are &quot;wikipedia_url&quot; and &quot;mid&quot;, respectively.
450 &quot;a_key&quot;: &quot;A String&quot;,
451 },
452 &quot;salience&quot;: 3.14, # The salience score associated with the entity in the [0, 1.0] range.
453 #
454 # The salience score for an entity provides information about the
455 # importance or centrality of that entity to the entire document text.
456 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
457 # salient.
458 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently
459 # supports proper noun mentions.
460 { # Represents a mention for an entity in the text. Currently, proper noun
461 # mentions are supported.
462 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
463 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
464 # document according to the EncodingType specified in the API request.
465 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
466 },
467 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
468 },
469 ],
470 },
471 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700472 &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
473 # AnnotateTextRequest.Features.extract_document_sentiment.
474 # the text.
475 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
476 # favor of score. Please refer to our documentation at
477 # https://cloud.google.com/natural-language/docs for more information.
478 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
479 # (positive sentiment).
480 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
481 # the absolute magnitude of sentiment regardless of score (positive or
482 # negative).
483 },
484 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified
485 # in the request or, if not specified, the automatically-detected language.
486 # See Document.language field for more details.
487 &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.
490 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
491 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original
492 # document according to the EncodingType specified in the API request.
493 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
494 },
495 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if
496 # AnnotateTextRequest.Features.extract_document_sentiment is set to
497 # true, this field will contain the sentiment for the sentence.
498 # the text.
499 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in
500 # favor of score. Please refer to our documentation at
501 # https://cloud.google.com/natural-language/docs for more information.
502 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0
503 # (positive sentiment).
504 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents
505 # the absolute magnitude of sentiment regardless of score (positive or
506 # negative).
507 },
508 },
509 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700510 }</pre>
511</div>
512
513</body></html>