blob: 8feeb1ad119b27627f2e5f9454430d4753b568f5 [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>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070079<p class="firstline">Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.</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>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070085<p class="firstline">Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.</p>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -080086<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>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070088<p class="firstline">A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call.</p>
89<p class="toc_element">
90 <code><a href="#close">close()</a></code></p>
91<p class="firstline">Close httplib2 connections.</p>
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070092<h3>Method Details</h3>
93<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070094 <code class="details" id="analyzeEntities">analyzeEntities(body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070095 <pre>Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070096
97Args:
Dan O'Mearadd494642020-05-01 07:42:23 -070098 body: object, The request body.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070099 The object takes the form of:
100
101{ # The entity analysis request message.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700102 &quot;document&quot;: { # ################################################################ # Represents the input to API methods. # Input document.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800103 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800104 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format. Cloud audit logging exempt since it is based on user data.
105 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. [Language Support](https://cloud.google.com/natural-language/docs/languages) lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an `INVALID_ARGUMENT` error is returned.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800106 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700107 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800108 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700109 }
110
111 x__xgafv: string, V1 error format.
112 Allowed values
113 1 - v1 error format
114 2 - v2 error format
115
116Returns:
117 An object of the form:
118
119 { # The entity analysis response message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700120 &quot;entities&quot;: [ # The recognized entities in the input document.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700121 { # Represents a phrase in the text that is a known entity, such as a person, an organization, or location. The API associates information, such as salience and mentions, with entities.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800122 &quot;type&quot;: &quot;A String&quot;, # The entity type.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800123 &quot;metadata&quot;: { # Metadata associated with the entity. Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are &quot;wikipedia_url&quot; and &quot;mid&quot;, respectively.
124 &quot;a_key&quot;: &quot;A String&quot;,
125 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800126 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently supports proper noun mentions.
127 { # Represents a mention for an entity in the text. Currently, proper noun mentions are supported.
128 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
129 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
130 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
131 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.
132 },
133 },
134 ],
135 &quot;salience&quot;: 3.14, # The salience score associated with the entity in the [0, 1.0] range. The salience score for an entity provides information about the importance or centrality of that entity to the entire document text. Scores closer to 0 are less salient, while scores closer to 1.0 are highly salient.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700136 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700137 },
138 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800139 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700140 }</pre>
141</div>
142
143<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700144 <code class="details" id="analyzeSentiment">analyzeSentiment(body=None, x__xgafv=None)</code>
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700145 <pre>Analyzes the sentiment of the provided text.
146
147Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700148 body: object, The request body.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700149 The object takes the form of:
150
151{ # The sentiment analysis request message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700152 &quot;document&quot;: { # ################################################################ # Represents the input to API methods. # Input document.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800153 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800154 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format. Cloud audit logging exempt since it is based on user data.
155 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. [Language Support](https://cloud.google.com/natural-language/docs/languages) lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an `INVALID_ARGUMENT` error is returned.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800156 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700157 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800158 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate sentence offsets for the sentence sentiment.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700159 }
160
161 x__xgafv: string, V1 error format.
162 Allowed values
163 1 - v1 error format
164 2 - v2 error format
165
166Returns:
167 An object of the form:
168
169 { # The sentiment analysis response message.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800170 &quot;documentSentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. # The overall sentiment of the input document.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800171 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800172 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in favor of score. Please refer to our documentation at https://cloud.google.com/natural-language/docs for more information.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800173 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).
174 },
175 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.
Bu Sun Kim65020912020-05-20 12:08:20 -0700176 &quot;sentences&quot;: [ # The sentiment for all the sentences in the document.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800177 { # Represents a sentence in the input document.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800178 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. # For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800179 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800180 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in favor of score. Please refer to our documentation at https://cloud.google.com/natural-language/docs for more information.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800181 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).
182 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700183 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800184 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800185 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800186 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800187 },
188 ],
189 }</pre>
190</div>
191
192<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700193 <code class="details" id="analyzeSyntax">analyzeSyntax(body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700194 <pre>Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800195
196Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700197 body: object, The request body.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800198 The object takes the form of:
199
200{ # The syntax analysis request message.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700201 &quot;document&quot;: { # ################################################################ # Represents the input to API methods. # Input document.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800202 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800203 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format. Cloud audit logging exempt since it is based on user data.
204 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. [Language Support](https://cloud.google.com/natural-language/docs/languages) lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an `INVALID_ARGUMENT` error is returned.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800205 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800206 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800207 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800208 }
209
210 x__xgafv: string, V1 error format.
211 Allowed values
212 1 - v1 error format
213 2 - v2 error format
214
215Returns:
216 An object of the form:
217
218 { # The syntax analysis response message.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800219 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.
220 &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
221 { # Represents the smallest syntactic building block of the text.
222 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
223 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree. This is the index of the token which has an arc going to this token. The index is the position of the token in the array of tokens returned by the API method. If this token is a root token, then the `head_token_index` is its own index.
224 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
225 },
226 &quot;text&quot;: { # Represents an output piece of text. # The token text.
227 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
228 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.
229 },
230 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
231 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
232 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
233 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
234 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
235 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
236 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
237 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
238 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
239 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
240 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
241 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
242 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
243 },
244 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
245 },
246 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800247 &quot;sentences&quot;: [ # Sentences in the input document.
248 { # Represents a sentence in the input document.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800249 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. # For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800250 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800251 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in favor of score. Please refer to our documentation at https://cloud.google.com/natural-language/docs for more information.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800252 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).
253 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800254 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800255 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800256 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800257 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800258 },
259 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700260 }</pre>
261</div>
262
263<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700264 <code class="details" id="annotateText">annotateText(body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700265 <pre>A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700266
267Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700268 body: object, The request body.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700269 The object takes the form of:
270
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700271{ # The request message for the text annotation API, which can perform multiple analysis types (sentiment, entities, and syntax) in one call.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700272 &quot;document&quot;: { # ################################################################ # Represents the input to API methods. # Input document.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800273 &quot;gcsContentUri&quot;: &quot;A String&quot;, # The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800274 &quot;content&quot;: &quot;A String&quot;, # The content of the input in string format. Cloud audit logging exempt since it is based on user data.
275 &quot;language&quot;: &quot;A String&quot;, # The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. [Language Support](https://cloud.google.com/natural-language/docs/languages) lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an `INVALID_ARGUMENT` error is returned.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800276 &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700277 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800278 &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700279 &quot;features&quot;: { # All available features for sentiment, syntax, and semantic analysis. Setting each one to true will enable that specific analysis for the input. # The enabled features.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700280 &quot;extractEntities&quot;: True or False, # Extract entities.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700281 &quot;extractSyntax&quot;: True or False, # Extract syntax information.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800282 &quot;extractDocumentSentiment&quot;: True or False, # Extract document-level sentiment.
Dan O'Mearadd494642020-05-01 07:42:23 -0700283 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700284 }
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 text annotations response message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700295 &quot;sentences&quot;: [ # Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.
296 { # Represents a sentence in the input document.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800297 &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. # For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800298 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800299 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in favor of score. Please refer to our documentation at https://cloud.google.com/natural-language/docs for more information.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800300 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).
301 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700302 &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800303 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800304 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800305 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800306 },
307 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800308 &quot;entities&quot;: [ # Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.
309 { # Represents a phrase in the text that is a known entity, such as a person, an organization, or location. The API associates information, such as salience and mentions, with entities.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800310 &quot;type&quot;: &quot;A String&quot;, # The entity type.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800311 &quot;metadata&quot;: { # Metadata associated with the entity. Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are &quot;wikipedia_url&quot; and &quot;mid&quot;, respectively.
312 &quot;a_key&quot;: &quot;A String&quot;,
313 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800314 &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently supports proper noun mentions.
315 { # Represents a mention for an entity in the text. Currently, proper noun mentions are supported.
316 &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
317 &quot;text&quot;: { # Represents an output piece of text. # The mention text.
318 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
319 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.
320 },
321 },
322 ],
323 &quot;salience&quot;: 3.14, # The salience score associated with the entity in the [0, 1.0] range. The salience score for an entity provides information about the importance or centrality of that entity to the entire document text. Scores closer to 0 are less salient, while scores closer to 1.0 are highly salient.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800324 &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800325 },
326 ],
327 &quot;language&quot;: &quot;A String&quot;, # The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.
328 &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.
329 { # Represents the smallest syntactic building block of the text.
330 &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
331 &quot;headTokenIndex&quot;: 42, # Represents the head of this token in the dependency tree. This is the index of the token which has an arc going to this token. The index is the position of the token in the array of tokens returned by the API method. If this token is a root token, then the `head_token_index` is its own index.
332 &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
333 },
334 &quot;text&quot;: { # Represents an output piece of text. # The token text.
335 &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
336 &quot;beginOffset&quot;: 42, # The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.
337 },
338 &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
339 &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
340 &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
341 &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
342 &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
343 &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
344 &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
345 &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
346 &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
347 &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
348 &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
349 &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
350 &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
351 },
352 &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800353 },
354 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800355 &quot;documentSentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. # The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800356 &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800357 &quot;polarity&quot;: 3.14, # DEPRECATED FIELD - This field is being deprecated in favor of score. Please refer to our documentation at https://cloud.google.com/natural-language/docs for more information.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800358 &quot;magnitude&quot;: 3.14, # A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).
359 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700360 }</pre>
361</div>
362
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700363<div class="method">
364 <code class="details" id="close">close()</code>
365 <pre>Close httplib2 connections.</pre>
366</div>
367
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700368</body></html>