Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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">Google 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, x__xgafv=None)</a></code></p> |
| 79 | <p class="firstline">Finds named entities (currently proper names and common nouns) in the text</p> |
| 80 | <p class="toc_element"> |
| 81 | <code><a href="#analyzeEntitySentiment">analyzeEntitySentiment(body, x__xgafv=None)</a></code></p> |
| 82 | <p class="firstline">Finds entities, similar to AnalyzeEntities in the text and analyzes</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#analyzeSentiment">analyzeSentiment(body, 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, x__xgafv=None)</a></code></p> |
| 88 | <p class="firstline">Analyzes the syntax of the text and provides sentence boundaries and</p> |
| 89 | <p class="toc_element"> |
| 90 | <code><a href="#annotateText">annotateText(body, x__xgafv=None)</a></code></p> |
| 91 | <p class="firstline">A convenience method that provides all syntax, sentiment, entity, and</p> |
| 92 | <h3>Method Details</h3> |
| 93 | <div class="method"> |
| 94 | <code class="details" id="analyzeEntities">analyzeEntities(body, x__xgafv=None)</code> |
| 95 | <pre>Finds named entities (currently proper names and common nouns) in the text |
| 96 | along with entity types, salience, mentions for each entity, and |
| 97 | other properties. |
| 98 | |
| 99 | Args: |
| 100 | body: object, The request body. (required) |
| 101 | The object takes the form of: |
| 102 | |
| 103 | { # The entity analysis request message. |
| 104 | "document": { # ################################################################ # # Input document. |
| 105 | # |
| 106 | # Represents the input to API methods. |
| 107 | "content": "A String", # The content of the input in string format. |
| 108 | "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`, |
| 109 | # returns an `INVALID_ARGUMENT` error. |
| 110 | "language": "A String", # The language of the document (if not specified, the language is |
| 111 | # automatically detected). Both ISO and BCP-47 language codes are |
| 112 | # accepted.<br> |
| 113 | # [Language Support](/natural-language/docs/languages) |
| 114 | # lists currently supported languages for each API method. |
| 115 | # If the language (either specified by the caller or automatically detected) |
| 116 | # is not supported by the called API method, an `INVALID_ARGUMENT` error |
| 117 | # is returned. |
| 118 | "gcsContentUri": "A String", # The Google Cloud Storage URI where the file content is located. |
| 119 | # This URI must be of the form: gs://bucket_name/object_name. For more |
| 120 | # details, see https://cloud.google.com/storage/docs/reference-uris. |
| 121 | # NOTE: Cloud Storage object versioning is not supported. |
| 122 | }, |
| 123 | "encodingType": "A String", # The encoding type used by the API to calculate offsets. |
| 124 | } |
| 125 | |
| 126 | x__xgafv: string, V1 error format. |
| 127 | Allowed values |
| 128 | 1 - v1 error format |
| 129 | 2 - v2 error format |
| 130 | |
| 131 | Returns: |
| 132 | An object of the form: |
| 133 | |
| 134 | { # The entity analysis response message. |
| 135 | "entities": [ # The recognized entities in the input document. |
| 136 | { # Represents a phrase in the text that is a known entity, such as |
| 137 | # a person, an organization, or location. The API associates information, such |
| 138 | # as salience and mentions, with entities. |
| 139 | "name": "A String", # The representative name for the entity. |
| 140 | "sentiment": { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if |
| 141 | # AnnotateTextRequest.Features.extract_entity_sentiment is set to |
| 142 | # true, this field will contain the aggregate sentiment expressed for this |
| 143 | # entity in the provided document. |
| 144 | # the text. |
| 145 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 146 | # (positive sentiment). |
| 147 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents |
| 148 | # the absolute magnitude of sentiment regardless of score (positive or |
| 149 | # negative). |
| 150 | }, |
| 151 | "salience": 3.14, # The salience score associated with the entity in the [0, 1.0] range. |
| 152 | # |
| 153 | # The salience score for an entity provides information about the |
| 154 | # importance or centrality of that entity to the entire document text. |
| 155 | # Scores closer to 0 are less salient, while scores closer to 1.0 are highly |
| 156 | # salient. |
| 157 | "mentions": [ # The mentions of this entity in the input document. The API currently |
| 158 | # supports proper noun mentions. |
| 159 | { # Represents a mention for an entity in the text. Currently, proper noun |
| 160 | # mentions are supported. |
| 161 | "text": { # Represents an output piece of text. # The mention text. |
| 162 | "content": "A String", # The content of the output text. |
| 163 | "beginOffset": 42, # The API calculates the beginning offset of the content in the original |
| 164 | # document according to the EncodingType specified in the API request. |
| 165 | }, |
| 166 | "type": "A String", # The type of the entity mention. |
| 167 | "sentiment": { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if |
| 168 | # AnnotateTextRequest.Features.extract_entity_sentiment is set to |
| 169 | # true, this field will contain the sentiment expressed for this mention of |
| 170 | # the entity in the provided document. |
| 171 | # the text. |
| 172 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 173 | # (positive sentiment). |
| 174 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents |
| 175 | # the absolute magnitude of sentiment regardless of score (positive or |
| 176 | # negative). |
| 177 | }, |
| 178 | }, |
| 179 | ], |
| 180 | "type": "A String", # The entity type. |
| 181 | "metadata": { # Metadata associated with the entity. |
| 182 | # |
| 183 | # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if |
| 184 | # available. The associated keys are "wikipedia_url" and "mid", respectively. |
| 185 | "a_key": "A String", |
| 186 | }, |
| 187 | }, |
| 188 | ], |
| 189 | "language": "A String", # The language of the text, which will be the same as the language specified |
| 190 | # in the request or, if not specified, the automatically-detected language. |
| 191 | # See Document.language field for more details. |
| 192 | }</pre> |
| 193 | </div> |
| 194 | |
| 195 | <div class="method"> |
| 196 | <code class="details" id="analyzeEntitySentiment">analyzeEntitySentiment(body, x__xgafv=None)</code> |
| 197 | <pre>Finds entities, similar to AnalyzeEntities in the text and analyzes |
| 198 | sentiment associated with each entity and its mentions. |
| 199 | |
| 200 | Args: |
| 201 | body: object, The request body. (required) |
| 202 | The object takes the form of: |
| 203 | |
| 204 | { # The entity-level sentiment analysis request message. |
| 205 | "encodingType": "A String", # The encoding type used by the API to calculate offsets. |
| 206 | "document": { # ################################################################ # # Input document. |
| 207 | # |
| 208 | # Represents the input to API methods. |
| 209 | "content": "A String", # The content of the input in string format. |
| 210 | "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`, |
| 211 | # returns an `INVALID_ARGUMENT` error. |
| 212 | "language": "A String", # The language of the document (if not specified, the language is |
| 213 | # automatically detected). Both ISO and BCP-47 language codes are |
| 214 | # accepted.<br> |
| 215 | # [Language Support](/natural-language/docs/languages) |
| 216 | # lists currently supported languages for each API method. |
| 217 | # If the language (either specified by the caller or automatically detected) |
| 218 | # is not supported by the called API method, an `INVALID_ARGUMENT` error |
| 219 | # is returned. |
| 220 | "gcsContentUri": "A String", # The Google Cloud Storage URI where the file content is located. |
| 221 | # This URI must be of the form: gs://bucket_name/object_name. For more |
| 222 | # details, see https://cloud.google.com/storage/docs/reference-uris. |
| 223 | # NOTE: Cloud Storage object versioning is not supported. |
| 224 | }, |
| 225 | } |
| 226 | |
| 227 | x__xgafv: string, V1 error format. |
| 228 | Allowed values |
| 229 | 1 - v1 error format |
| 230 | 2 - v2 error format |
| 231 | |
| 232 | Returns: |
| 233 | An object of the form: |
| 234 | |
| 235 | { # The entity-level sentiment analysis response message. |
| 236 | "entities": [ # The recognized entities in the input document with associated sentiments. |
| 237 | { # Represents a phrase in the text that is a known entity, such as |
| 238 | # a person, an organization, or location. The API associates information, such |
| 239 | # as salience and mentions, with entities. |
| 240 | "name": "A String", # The representative name for the entity. |
| 241 | "sentiment": { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if |
| 242 | # AnnotateTextRequest.Features.extract_entity_sentiment is set to |
| 243 | # true, this field will contain the aggregate sentiment expressed for this |
| 244 | # entity in the provided document. |
| 245 | # the text. |
| 246 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 247 | # (positive sentiment). |
| 248 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents |
| 249 | # the absolute magnitude of sentiment regardless of score (positive or |
| 250 | # negative). |
| 251 | }, |
| 252 | "salience": 3.14, # The salience score associated with the entity in the [0, 1.0] range. |
| 253 | # |
| 254 | # The salience score for an entity provides information about the |
| 255 | # importance or centrality of that entity to the entire document text. |
| 256 | # Scores closer to 0 are less salient, while scores closer to 1.0 are highly |
| 257 | # salient. |
| 258 | "mentions": [ # The mentions of this entity in the input document. The API currently |
| 259 | # supports proper noun mentions. |
| 260 | { # Represents a mention for an entity in the text. Currently, proper noun |
| 261 | # mentions are supported. |
| 262 | "text": { # Represents an output piece of text. # The mention text. |
| 263 | "content": "A String", # The content of the output text. |
| 264 | "beginOffset": 42, # The API calculates the beginning offset of the content in the original |
| 265 | # document according to the EncodingType specified in the API request. |
| 266 | }, |
| 267 | "type": "A String", # The type of the entity mention. |
| 268 | "sentiment": { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if |
| 269 | # AnnotateTextRequest.Features.extract_entity_sentiment is set to |
| 270 | # true, this field will contain the sentiment expressed for this mention of |
| 271 | # the entity in the provided document. |
| 272 | # the text. |
| 273 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 274 | # (positive sentiment). |
| 275 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents |
| 276 | # the absolute magnitude of sentiment regardless of score (positive or |
| 277 | # negative). |
| 278 | }, |
| 279 | }, |
| 280 | ], |
| 281 | "type": "A String", # The entity type. |
| 282 | "metadata": { # Metadata associated with the entity. |
| 283 | # |
| 284 | # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if |
| 285 | # available. The associated keys are "wikipedia_url" and "mid", respectively. |
| 286 | "a_key": "A String", |
| 287 | }, |
| 288 | }, |
| 289 | ], |
| 290 | "language": "A String", # The language of the text, which will be the same as the language specified |
| 291 | # in the request or, if not specified, the automatically-detected language. |
| 292 | # See Document.language field for more details. |
| 293 | }</pre> |
| 294 | </div> |
| 295 | |
| 296 | <div class="method"> |
| 297 | <code class="details" id="analyzeSentiment">analyzeSentiment(body, x__xgafv=None)</code> |
| 298 | <pre>Analyzes the sentiment of the provided text. |
| 299 | |
| 300 | Args: |
| 301 | body: object, The request body. (required) |
| 302 | The object takes the form of: |
| 303 | |
| 304 | { # The sentiment analysis request message. |
| 305 | "document": { # ################################################################ # # Input document. |
| 306 | # |
| 307 | # Represents the input to API methods. |
| 308 | "content": "A String", # The content of the input in string format. |
| 309 | "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`, |
| 310 | # returns an `INVALID_ARGUMENT` error. |
| 311 | "language": "A String", # The language of the document (if not specified, the language is |
| 312 | # automatically detected). Both ISO and BCP-47 language codes are |
| 313 | # accepted.<br> |
| 314 | # [Language Support](/natural-language/docs/languages) |
| 315 | # lists currently supported languages for each API method. |
| 316 | # If the language (either specified by the caller or automatically detected) |
| 317 | # is not supported by the called API method, an `INVALID_ARGUMENT` error |
| 318 | # is returned. |
| 319 | "gcsContentUri": "A String", # The Google Cloud Storage URI where the file content is located. |
| 320 | # This URI must be of the form: gs://bucket_name/object_name. For more |
| 321 | # details, see https://cloud.google.com/storage/docs/reference-uris. |
| 322 | # NOTE: Cloud Storage object versioning is not supported. |
| 323 | }, |
| 324 | "encodingType": "A String", # The encoding type used by the API to calculate sentence offsets for the |
| 325 | # sentence sentiment. |
| 326 | } |
| 327 | |
| 328 | x__xgafv: string, V1 error format. |
| 329 | Allowed values |
| 330 | 1 - v1 error format |
| 331 | 2 - v2 error format |
| 332 | |
| 333 | Returns: |
| 334 | An object of the form: |
| 335 | |
| 336 | { # The sentiment analysis response message. |
| 337 | "documentSentiment": { # Represents the feeling associated with the entire text or entities in # The overall sentiment of the input document. |
| 338 | # the text. |
| 339 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 340 | # (positive sentiment). |
| 341 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents |
| 342 | # the absolute magnitude of sentiment regardless of score (positive or |
| 343 | # negative). |
| 344 | }, |
| 345 | "language": "A String", # The language of the text, which will be the same as the language specified |
| 346 | # in the request or, if not specified, the automatically-detected language. |
| 347 | # See Document.language field for more details. |
| 348 | "sentences": [ # The sentiment for all the sentences in the document. |
| 349 | { # Represents a sentence in the input document. |
| 350 | "text": { # Represents an output piece of text. # The sentence text. |
| 351 | "content": "A String", # The content of the output text. |
| 352 | "beginOffset": 42, # The API calculates the beginning offset of the content in the original |
| 353 | # document according to the EncodingType specified in the API request. |
| 354 | }, |
| 355 | "sentiment": { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if |
| 356 | # AnnotateTextRequest.Features.extract_document_sentiment is set to |
| 357 | # true, this field will contain the sentiment for the sentence. |
| 358 | # the text. |
| 359 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 360 | # (positive sentiment). |
| 361 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents |
| 362 | # the absolute magnitude of sentiment regardless of score (positive or |
| 363 | # negative). |
| 364 | }, |
| 365 | }, |
| 366 | ], |
| 367 | }</pre> |
| 368 | </div> |
| 369 | |
| 370 | <div class="method"> |
| 371 | <code class="details" id="analyzeSyntax">analyzeSyntax(body, x__xgafv=None)</code> |
| 372 | <pre>Analyzes the syntax of the text and provides sentence boundaries and |
| 373 | tokenization along with part of speech tags, dependency trees, and other |
| 374 | properties. |
| 375 | |
| 376 | Args: |
| 377 | body: object, The request body. (required) |
| 378 | The object takes the form of: |
| 379 | |
| 380 | { # The syntax analysis request message. |
| 381 | "document": { # ################################################################ # # Input document. |
| 382 | # |
| 383 | # Represents the input to API methods. |
| 384 | "content": "A String", # The content of the input in string format. |
| 385 | "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`, |
| 386 | # returns an `INVALID_ARGUMENT` error. |
| 387 | "language": "A String", # The language of the document (if not specified, the language is |
| 388 | # automatically detected). Both ISO and BCP-47 language codes are |
| 389 | # accepted.<br> |
| 390 | # [Language Support](/natural-language/docs/languages) |
| 391 | # lists currently supported languages for each API method. |
| 392 | # If the language (either specified by the caller or automatically detected) |
| 393 | # is not supported by the called API method, an `INVALID_ARGUMENT` error |
| 394 | # is returned. |
| 395 | "gcsContentUri": "A String", # The Google Cloud Storage URI where the file content is located. |
| 396 | # This URI must be of the form: gs://bucket_name/object_name. For more |
| 397 | # details, see https://cloud.google.com/storage/docs/reference-uris. |
| 398 | # NOTE: Cloud Storage object versioning is not supported. |
| 399 | }, |
| 400 | "encodingType": "A String", # The encoding type used by the API to calculate offsets. |
| 401 | } |
| 402 | |
| 403 | x__xgafv: string, V1 error format. |
| 404 | Allowed values |
| 405 | 1 - v1 error format |
| 406 | 2 - v2 error format |
| 407 | |
| 408 | Returns: |
| 409 | An object of the form: |
| 410 | |
| 411 | { # The syntax analysis response message. |
| 412 | "tokens": [ # Tokens, along with their syntactic information, in the input document. |
| 413 | { # Represents the smallest syntactic building block of the text. |
| 414 | "text": { # Represents an output piece of text. # The token text. |
| 415 | "content": "A String", # The content of the output text. |
| 416 | "beginOffset": 42, # The API calculates the beginning offset of the content in the original |
| 417 | # document according to the EncodingType specified in the API request. |
| 418 | }, |
| 419 | "partOfSpeech": { # Represents part of speech information for a token. # Parts of speech tag for this token. |
| 420 | "case": "A String", # The grammatical case. |
| 421 | "reciprocity": "A String", # The grammatical reciprocity. |
| 422 | "mood": "A String", # The grammatical mood. |
| 423 | "form": "A String", # The grammatical form. |
| 424 | "gender": "A String", # The grammatical gender. |
| 425 | "number": "A String", # The grammatical number. |
| 426 | "person": "A String", # The grammatical person. |
| 427 | "tag": "A String", # The part of speech tag. |
| 428 | "tense": "A String", # The grammatical tense. |
| 429 | "aspect": "A String", # The grammatical aspect. |
| 430 | "proper": "A String", # The grammatical properness. |
| 431 | "voice": "A String", # The grammatical voice. |
| 432 | }, |
| 433 | "dependencyEdge": { # Represents dependency parse tree information for a token. # Dependency tree parse for this token. |
| 434 | "headTokenIndex": 42, # Represents the head of this token in the dependency tree. |
| 435 | # This is the index of the token which has an arc going to this token. |
| 436 | # The index is the position of the token in the array of tokens returned |
| 437 | # by the API method. If this token is a root token, then the |
| 438 | # `head_token_index` is its own index. |
| 439 | "label": "A String", # The parse label for the token. |
| 440 | }, |
| 441 | "lemma": "A String", # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. |
| 442 | }, |
| 443 | ], |
| 444 | "language": "A String", # The language of the text, which will be the same as the language specified |
| 445 | # in the request or, if not specified, the automatically-detected language. |
| 446 | # See Document.language field for more details. |
| 447 | "sentences": [ # Sentences in the input document. |
| 448 | { # Represents a sentence in the input document. |
| 449 | "text": { # Represents an output piece of text. # The sentence text. |
| 450 | "content": "A String", # The content of the output text. |
| 451 | "beginOffset": 42, # The API calculates the beginning offset of the content in the original |
| 452 | # document according to the EncodingType specified in the API request. |
| 453 | }, |
| 454 | "sentiment": { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if |
| 455 | # AnnotateTextRequest.Features.extract_document_sentiment is set to |
| 456 | # true, this field will contain the sentiment for the sentence. |
| 457 | # the text. |
| 458 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 459 | # (positive sentiment). |
| 460 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents |
| 461 | # the absolute magnitude of sentiment regardless of score (positive or |
| 462 | # negative). |
| 463 | }, |
| 464 | }, |
| 465 | ], |
| 466 | }</pre> |
| 467 | </div> |
| 468 | |
| 469 | <div class="method"> |
| 470 | <code class="details" id="annotateText">annotateText(body, x__xgafv=None)</code> |
| 471 | <pre>A convenience method that provides all syntax, sentiment, entity, and |
| 472 | classification features in one call. |
| 473 | |
| 474 | Args: |
| 475 | body: object, The request body. (required) |
| 476 | The object takes the form of: |
| 477 | |
| 478 | { # The request message for the text annotation API, which can perform multiple |
| 479 | # analysis types (sentiment, entities, and syntax) in one call. |
| 480 | "encodingType": "A String", # The encoding type used by the API to calculate offsets. |
| 481 | "document": { # ################################################################ # # Input document. |
| 482 | # |
| 483 | # Represents the input to API methods. |
| 484 | "content": "A String", # The content of the input in string format. |
| 485 | "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`, |
| 486 | # returns an `INVALID_ARGUMENT` error. |
| 487 | "language": "A String", # The language of the document (if not specified, the language is |
| 488 | # automatically detected). Both ISO and BCP-47 language codes are |
| 489 | # accepted.<br> |
| 490 | # [Language Support](/natural-language/docs/languages) |
| 491 | # lists currently supported languages for each API method. |
| 492 | # If the language (either specified by the caller or automatically detected) |
| 493 | # is not supported by the called API method, an `INVALID_ARGUMENT` error |
| 494 | # is returned. |
| 495 | "gcsContentUri": "A String", # The Google Cloud Storage URI where the file content is located. |
| 496 | # This URI must be of the form: gs://bucket_name/object_name. For more |
| 497 | # details, see https://cloud.google.com/storage/docs/reference-uris. |
| 498 | # NOTE: Cloud Storage object versioning is not supported. |
| 499 | }, |
| 500 | "features": { # All available features for sentiment, syntax, and semantic analysis. # The enabled features. |
| 501 | # Setting each one to true will enable that specific analysis for the input. |
| 502 | "extractEntitySentiment": True or False, # Extract entities and their associated sentiment. |
| 503 | "extractDocumentSentiment": True or False, # Extract document-level sentiment. |
| 504 | "extractEntities": True or False, # Extract entities. |
| 505 | "extractSyntax": True or False, # Extract syntax information. |
| 506 | }, |
| 507 | } |
| 508 | |
| 509 | x__xgafv: string, V1 error format. |
| 510 | Allowed values |
| 511 | 1 - v1 error format |
| 512 | 2 - v2 error format |
| 513 | |
| 514 | Returns: |
| 515 | An object of the form: |
| 516 | |
| 517 | { # The text annotations response message. |
| 518 | "tokens": [ # Tokens, along with their syntactic information, in the input document. |
| 519 | # Populated if the user enables |
| 520 | # AnnotateTextRequest.Features.extract_syntax. |
| 521 | { # Represents the smallest syntactic building block of the text. |
| 522 | "text": { # Represents an output piece of text. # The token text. |
| 523 | "content": "A String", # The content of the output text. |
| 524 | "beginOffset": 42, # The API calculates the beginning offset of the content in the original |
| 525 | # document according to the EncodingType specified in the API request. |
| 526 | }, |
| 527 | "partOfSpeech": { # Represents part of speech information for a token. # Parts of speech tag for this token. |
| 528 | "case": "A String", # The grammatical case. |
| 529 | "reciprocity": "A String", # The grammatical reciprocity. |
| 530 | "mood": "A String", # The grammatical mood. |
| 531 | "form": "A String", # The grammatical form. |
| 532 | "gender": "A String", # The grammatical gender. |
| 533 | "number": "A String", # The grammatical number. |
| 534 | "person": "A String", # The grammatical person. |
| 535 | "tag": "A String", # The part of speech tag. |
| 536 | "tense": "A String", # The grammatical tense. |
| 537 | "aspect": "A String", # The grammatical aspect. |
| 538 | "proper": "A String", # The grammatical properness. |
| 539 | "voice": "A String", # The grammatical voice. |
| 540 | }, |
| 541 | "dependencyEdge": { # Represents dependency parse tree information for a token. # Dependency tree parse for this token. |
| 542 | "headTokenIndex": 42, # Represents the head of this token in the dependency tree. |
| 543 | # This is the index of the token which has an arc going to this token. |
| 544 | # The index is the position of the token in the array of tokens returned |
| 545 | # by the API method. If this token is a root token, then the |
| 546 | # `head_token_index` is its own index. |
| 547 | "label": "A String", # The parse label for the token. |
| 548 | }, |
| 549 | "lemma": "A String", # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. |
| 550 | }, |
| 551 | ], |
| 552 | "entities": [ # Entities, along with their semantic information, in the input document. |
| 553 | # Populated if the user enables |
| 554 | # AnnotateTextRequest.Features.extract_entities. |
| 555 | { # Represents a phrase in the text that is a known entity, such as |
| 556 | # a person, an organization, or location. The API associates information, such |
| 557 | # as salience and mentions, with entities. |
| 558 | "name": "A String", # The representative name for the entity. |
| 559 | "sentiment": { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if |
| 560 | # AnnotateTextRequest.Features.extract_entity_sentiment is set to |
| 561 | # true, this field will contain the aggregate sentiment expressed for this |
| 562 | # entity in the provided document. |
| 563 | # the text. |
| 564 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 565 | # (positive sentiment). |
| 566 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents |
| 567 | # the absolute magnitude of sentiment regardless of score (positive or |
| 568 | # negative). |
| 569 | }, |
| 570 | "salience": 3.14, # The salience score associated with the entity in the [0, 1.0] range. |
| 571 | # |
| 572 | # The salience score for an entity provides information about the |
| 573 | # importance or centrality of that entity to the entire document text. |
| 574 | # Scores closer to 0 are less salient, while scores closer to 1.0 are highly |
| 575 | # salient. |
| 576 | "mentions": [ # The mentions of this entity in the input document. The API currently |
| 577 | # supports proper noun mentions. |
| 578 | { # Represents a mention for an entity in the text. Currently, proper noun |
| 579 | # mentions are supported. |
| 580 | "text": { # Represents an output piece of text. # The mention text. |
| 581 | "content": "A String", # The content of the output text. |
| 582 | "beginOffset": 42, # The API calculates the beginning offset of the content in the original |
| 583 | # document according to the EncodingType specified in the API request. |
| 584 | }, |
| 585 | "type": "A String", # The type of the entity mention. |
| 586 | "sentiment": { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeEntitySentiment or if |
| 587 | # AnnotateTextRequest.Features.extract_entity_sentiment is set to |
| 588 | # true, this field will contain the sentiment expressed for this mention of |
| 589 | # the entity in the provided document. |
| 590 | # the text. |
| 591 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 592 | # (positive sentiment). |
| 593 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents |
| 594 | # the absolute magnitude of sentiment regardless of score (positive or |
| 595 | # negative). |
| 596 | }, |
| 597 | }, |
| 598 | ], |
| 599 | "type": "A String", # The entity type. |
| 600 | "metadata": { # Metadata associated with the entity. |
| 601 | # |
| 602 | # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if |
| 603 | # available. The associated keys are "wikipedia_url" and "mid", respectively. |
| 604 | "a_key": "A String", |
| 605 | }, |
| 606 | }, |
| 607 | ], |
| 608 | "documentSentiment": { # Represents the feeling associated with the entire text or entities in # The overall sentiment for the document. Populated if the user enables |
| 609 | # AnnotateTextRequest.Features.extract_document_sentiment. |
| 610 | # the text. |
| 611 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 612 | # (positive sentiment). |
| 613 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents |
| 614 | # the absolute magnitude of sentiment regardless of score (positive or |
| 615 | # negative). |
| 616 | }, |
| 617 | "language": "A String", # The language of the text, which will be the same as the language specified |
| 618 | # in the request or, if not specified, the automatically-detected language. |
| 619 | # See Document.language field for more details. |
| 620 | "sentences": [ # Sentences in the input document. Populated if the user enables |
| 621 | # AnnotateTextRequest.Features.extract_syntax. |
| 622 | { # Represents a sentence in the input document. |
| 623 | "text": { # Represents an output piece of text. # The sentence text. |
| 624 | "content": "A String", # The content of the output text. |
| 625 | "beginOffset": 42, # The API calculates the beginning offset of the content in the original |
| 626 | # document according to the EncodingType specified in the API request. |
| 627 | }, |
| 628 | "sentiment": { # Represents the feeling associated with the entire text or entities in # For calls to AnalyzeSentiment or if |
| 629 | # AnnotateTextRequest.Features.extract_document_sentiment is set to |
| 630 | # true, this field will contain the sentiment for the sentence. |
| 631 | # the text. |
| 632 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 633 | # (positive sentiment). |
| 634 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents |
| 635 | # the absolute magnitude of sentiment regardless of score (positive or |
| 636 | # negative). |
| 637 | }, |
| 638 | }, |
| 639 | ], |
| 640 | }</pre> |
| 641 | </div> |
| 642 | |
| 643 | </body></html> |