1<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
75<h1><a href="language_v1beta2.html">Cloud Natural Language API</a> . <a href="language_v1beta2.documents.html">documents</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78  <code><a href="#analyzeEntities">analyzeEntities(body=None, x__xgafv=None)</a></code></p>
79<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>
80<p class="toc_element">
81  <code><a href="#analyzeEntitySentiment">analyzeEntitySentiment(body=None, x__xgafv=None)</a></code></p>
82<p class="firstline">Finds entities, similar to AnalyzeEntities in the text and analyzes sentiment associated with each entity and its mentions.</p>
83<p class="toc_element">
84  <code><a href="#analyzeSentiment">analyzeSentiment(body=None, x__xgafv=None)</a></code></p>
85<p class="firstline">Analyzes the sentiment of the provided text.</p>
86<p class="toc_element">
87  <code><a href="#analyzeSyntax">analyzeSyntax(body=None, x__xgafv=None)</a></code></p>
88<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>
89<p class="toc_element">
90  <code><a href="#annotateText">annotateText(body=None, x__xgafv=None)</a></code></p>
91<p class="firstline">A convenience method that provides all syntax, sentiment, entity, and classification features in one call.</p>
92<p class="toc_element">
93  <code><a href="#classifyText">classifyText(body=None, x__xgafv=None)</a></code></p>
94<p class="firstline">Classifies a document into categories.</p>
95<p class="toc_element">
96  <code><a href="#close">close()</a></code></p>
97<p class="firstline">Close httplib2 connections.</p>
98<h3>Method Details</h3>
99<div class="method">
100    <code class="details" id="analyzeEntities">analyzeEntities(body=None, x__xgafv=None)</code>
101  <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.
102
103Args:
104  body: object, The request body.
105    The object takes the form of:
106
107{ # The entity analysis request message.
108  &quot;document&quot;: { # ################################################################ # Represents the input to API methods. # Required. Input document.
109    &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
110    &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.
111    &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.
112    &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.
113    &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
114    &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
115  },
116  &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
117}
118
119  x__xgafv: string, V1 error format.
120    Allowed values
121      1 - v1 error format
122      2 - v2 error format
123
124Returns:
125  An object of the form:
126
127    { # The entity analysis response message.
128  &quot;entities&quot;: [ # The recognized entities in the input document.
129    { # 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.
130      &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently supports proper noun mentions.
131        { # Represents a mention for an entity in the text. Currently, proper noun mentions are supported.
132          &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # For calls to AnalyzeEntitySentiment or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.
133            &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).
134            &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
135          },
136          &quot;text&quot;: { # Represents an output piece of text. # The mention text.
137            &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.
138            &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
139          },
140          &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
141        },
142      ],
143      &quot;metadata&quot;: { # Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
144        &quot;a_key&quot;: &quot;A String&quot;,
145      },
146      &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
147      &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.
148      &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # For calls to AnalyzeEntitySentiment or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
149        &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).
150        &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
151      },
152      &quot;type&quot;: &quot;A String&quot;, # The entity type.
153    },
154  ],
155  &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.
156}</pre>
157</div>
158
159<div class="method">
160    <code class="details" id="analyzeEntitySentiment">analyzeEntitySentiment(body=None, x__xgafv=None)</code>
161  <pre>Finds entities, similar to AnalyzeEntities in the text and analyzes sentiment associated with each entity and its mentions.
162
163Args:
164  body: object, The request body.
165    The object takes the form of:
166
167{ # The entity-level sentiment analysis request message.
168  &quot;document&quot;: { # ################################################################ # Represents the input to API methods. # Required. Input document.
169    &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
170    &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.
171    &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.
172    &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.
173    &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
174    &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
175  },
176  &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
177}
178
179  x__xgafv: string, V1 error format.
180    Allowed values
181      1 - v1 error format
182      2 - v2 error format
183
184Returns:
185  An object of the form:
186
187    { # The entity-level sentiment analysis response message.
188  &quot;entities&quot;: [ # The recognized entities in the input document with associated sentiments.
189    { # 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.
190      &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently supports proper noun mentions.
191        { # Represents a mention for an entity in the text. Currently, proper noun mentions are supported.
192          &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # For calls to AnalyzeEntitySentiment or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.
193            &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).
194            &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
195          },
196          &quot;text&quot;: { # Represents an output piece of text. # The mention text.
197            &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.
198            &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
199          },
200          &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
201        },
202      ],
203      &quot;metadata&quot;: { # Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
204        &quot;a_key&quot;: &quot;A String&quot;,
205      },
206      &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
207      &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.
208      &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # For calls to AnalyzeEntitySentiment or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
209        &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).
210        &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
211      },
212      &quot;type&quot;: &quot;A String&quot;, # The entity type.
213    },
214  ],
215  &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.
216}</pre>
217</div>
218
219<div class="method">
220    <code class="details" id="analyzeSentiment">analyzeSentiment(body=None, x__xgafv=None)</code>
221  <pre>Analyzes the sentiment of the provided text.
222
223Args:
224  body: object, The request body.
225    The object takes the form of:
226
227{ # The sentiment analysis request message.
228  &quot;document&quot;: { # ################################################################ # Represents the input to API methods. # Required. Input document.
229    &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
230    &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.
231    &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.
232    &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.
233    &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
234    &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
235  },
236  &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate sentence offsets for the sentence sentiment.
237}
238
239  x__xgafv: string, V1 error format.
240    Allowed values
241      1 - v1 error format
242      2 - v2 error format
243
244Returns:
245  An object of the form:
246
247    { # The sentiment analysis response message.
248  &quot;documentSentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # The overall sentiment of the input document.
249    &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).
250    &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
251  },
252  &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.
253  &quot;sentences&quot;: [ # The sentiment for all the sentences in the document.
254    { # Represents a sentence in the input document.
255      &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.
256        &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).
257        &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
258      },
259      &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
260        &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.
261        &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
262      },
263    },
264  ],
265}</pre>
266</div>
267
268<div class="method">
269    <code class="details" id="analyzeSyntax">analyzeSyntax(body=None, x__xgafv=None)</code>
270  <pre>Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.
271
272Args:
273  body: object, The request body.
274    The object takes the form of:
275
276{ # The syntax analysis request message.
277  &quot;document&quot;: { # ################################################################ # Represents the input to API methods. # Required. Input document.
278    &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
279    &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.
280    &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.
281    &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.
282    &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
283    &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
284  },
285  &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
286}
287
288  x__xgafv: string, V1 error format.
289    Allowed values
290      1 - v1 error format
291      2 - v2 error format
292
293Returns:
294  An object of the form:
295
296    { # The syntax analysis response message.
297  &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.
298  &quot;sentences&quot;: [ # Sentences in the input document.
299    { # Represents a sentence in the input document.
300      &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.
301        &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).
302        &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
303      },
304      &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
305        &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.
306        &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
307      },
308    },
309  ],
310  &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document.
311    { # Represents the smallest syntactic building block of the text.
312      &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
313        &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.
314        &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
315      },
316      &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
317      &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
318        &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
319        &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
320        &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
321        &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
322        &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
323        &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
324        &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
325        &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
326        &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
327        &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
328        &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
329        &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
330      },
331      &quot;text&quot;: { # Represents an output piece of text. # The token text.
332        &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.
333        &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
334      },
335    },
336  ],
337}</pre>
338</div>
339
340<div class="method">
341    <code class="details" id="annotateText">annotateText(body=None, x__xgafv=None)</code>
342  <pre>A convenience method that provides all syntax, sentiment, entity, and classification features in one call.
343
344Args:
345  body: object, The request body.
346    The object takes the form of:
347
348{ # The request message for the text annotation API, which can perform multiple analysis types (sentiment, entities, and syntax) in one call.
349  &quot;document&quot;: { # ################################################################ # Represents the input to API methods. # Required. Input document.
350    &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
351    &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.
352    &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.
353    &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.
354    &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
355    &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
356  },
357  &quot;encodingType&quot;: &quot;A String&quot;, # The encoding type used by the API to calculate offsets.
358  &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. Next ID: 10 # Required. The enabled features.
359    &quot;classifyText&quot;: True or False, # Classify the full document into categories. If this is true, the API will use the default model which classifies into a [predefined taxonomy](https://cloud.google.com/natural-language/docs/categories).
360    &quot;extractDocumentSentiment&quot;: True or False, # Extract document-level sentiment.
361    &quot;extractEntities&quot;: True or False, # Extract entities.
362    &quot;extractEntitySentiment&quot;: True or False, # Extract entities and their associated sentiment.
363    &quot;extractSyntax&quot;: True or False, # Extract syntax information.
364  },
365}
366
367  x__xgafv: string, V1 error format.
368    Allowed values
369      1 - v1 error format
370      2 - v2 error format
371
372Returns:
373  An object of the form:
374
375    { # The text annotations response message.
376  &quot;categories&quot;: [ # Categories identified in the input document.
377    { # Represents a category returned from the text classifier.
378      &quot;confidence&quot;: 3.14, # The classifier&#x27;s confidence of the category. Number represents how certain the classifier is that this category represents the given text.
379      &quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document, from the [predefined taxonomy](https://cloud.google.com/natural-language/docs/categories).
380    },
381  ],
382  &quot;documentSentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.
383    &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).
384    &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
385  },
386  &quot;entities&quot;: [ # Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.
387    { # 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.
388      &quot;mentions&quot;: [ # The mentions of this entity in the input document. The API currently supports proper noun mentions.
389        { # Represents a mention for an entity in the text. Currently, proper noun mentions are supported.
390          &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # For calls to AnalyzeEntitySentiment or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.
391            &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).
392            &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
393          },
394          &quot;text&quot;: { # Represents an output piece of text. # The mention text.
395            &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.
396            &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
397          },
398          &quot;type&quot;: &quot;A String&quot;, # The type of the entity mention.
399        },
400      ],
401      &quot;metadata&quot;: { # Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
402        &quot;a_key&quot;: &quot;A String&quot;,
403      },
404      &quot;name&quot;: &quot;A String&quot;, # The representative name for the entity.
405      &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.
406      &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # For calls to AnalyzeEntitySentiment or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
407        &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).
408        &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
409      },
410      &quot;type&quot;: &quot;A String&quot;, # The entity type.
411    },
412  ],
413  &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.
414  &quot;sentences&quot;: [ # Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.
415    { # Represents a sentence in the input document.
416      &quot;sentiment&quot;: { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.
417        &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).
418        &quot;score&quot;: 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
419      },
420      &quot;text&quot;: { # Represents an output piece of text. # The sentence text.
421        &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.
422        &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
423      },
424    },
425  ],
426  &quot;tokens&quot;: [ # Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.
427    { # Represents the smallest syntactic building block of the text.
428      &quot;dependencyEdge&quot;: { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
429        &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.
430        &quot;label&quot;: &quot;A String&quot;, # The parse label for the token.
431      },
432      &quot;lemma&quot;: &quot;A String&quot;, # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
433      &quot;partOfSpeech&quot;: { # Represents part of speech information for a token. # Parts of speech tag for this token.
434        &quot;aspect&quot;: &quot;A String&quot;, # The grammatical aspect.
435        &quot;case&quot;: &quot;A String&quot;, # The grammatical case.
436        &quot;form&quot;: &quot;A String&quot;, # The grammatical form.
437        &quot;gender&quot;: &quot;A String&quot;, # The grammatical gender.
438        &quot;mood&quot;: &quot;A String&quot;, # The grammatical mood.
439        &quot;number&quot;: &quot;A String&quot;, # The grammatical number.
440        &quot;person&quot;: &quot;A String&quot;, # The grammatical person.
441        &quot;proper&quot;: &quot;A String&quot;, # The grammatical properness.
442        &quot;reciprocity&quot;: &quot;A String&quot;, # The grammatical reciprocity.
443        &quot;tag&quot;: &quot;A String&quot;, # The part of speech tag.
444        &quot;tense&quot;: &quot;A String&quot;, # The grammatical tense.
445        &quot;voice&quot;: &quot;A String&quot;, # The grammatical voice.
446      },
447      &quot;text&quot;: { # Represents an output piece of text. # The token text.
448        &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.
449        &quot;content&quot;: &quot;A String&quot;, # The content of the output text.
450      },
451    },
452  ],
453}</pre>
454</div>
455
456<div class="method">
457    <code class="details" id="classifyText">classifyText(body=None, x__xgafv=None)</code>
458  <pre>Classifies a document into categories.
459
460Args:
461  body: object, The request body.
462    The object takes the form of:
463
464{ # The document classification request message.
465  &quot;document&quot;: { # ################################################################ # Represents the input to API methods. # Required. Input document.
466    &quot;boilerplateHandling&quot;: &quot;A String&quot;, # Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
467    &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.
468    &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.
469    &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.
470    &quot;referenceWebUri&quot;: &quot;A String&quot;, # The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
471    &quot;type&quot;: &quot;A String&quot;, # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
472  },
473}
474
475  x__xgafv: string, V1 error format.
476    Allowed values
477      1 - v1 error format
478      2 - v2 error format
479
480Returns:
481  An object of the form:
482
483    { # The document classification response message.
484  &quot;categories&quot;: [ # Categories representing the input document.
485    { # Represents a category returned from the text classifier.
486      &quot;confidence&quot;: 3.14, # The classifier&#x27;s confidence of the category. Number represents how certain the classifier is that this category represents the given text.
487      &quot;name&quot;: &quot;A String&quot;, # The name of the category representing the document, from the [predefined taxonomy](https://cloud.google.com/natural-language/docs/categories).
488    },
489  ],
490}</pre>
491</div>
492
493<div class="method">
494    <code class="details" id="close">close()</code>
495  <pre>Close httplib2 connections.</pre>
496</div>
497
498</body></html>