Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [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 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 75 | <h1><a href="language_v1beta1.html">Cloud Natural Language API</a> . <a href="language_v1beta1.documents.html">documents</a></h1> |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 78 | <code><a href="#analyzeEntities">analyzeEntities(body=None, x__xgafv=None)</a></code></p> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 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> |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 80 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 81 | <code><a href="#analyzeSentiment">analyzeSentiment(body=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 82 | <p class="firstline">Analyzes the sentiment of the provided text.</p> |
| 83 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 84 | <code><a href="#analyzeSyntax">analyzeSyntax(body=None, x__xgafv=None)</a></code></p> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 85 | <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 Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 86 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 87 | <code><a href="#annotateText">annotateText(body=None, x__xgafv=None)</a></code></p> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 88 | <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 Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 92 | <h3>Method Details</h3> |
| 93 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 94 | <code class="details" id="analyzeEntities">analyzeEntities(body=None, x__xgafv=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 95 | <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 Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 96 | |
| 97 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 98 | body: object, The request body. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 99 | The object takes the form of: |
| 100 | |
| 101 | { # The entity analysis request message. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 102 | "document": { # ################################################################ # Represents the input to API methods. # Input document. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 103 | "language": "A String", # 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. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 104 | "gcsContentUri": "A String", # 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. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 105 | "content": "A String", # The content of the input in string format. Cloud audit logging exempt since it is based on user data. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 106 | "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 107 | }, |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 108 | "encodingType": "A String", # The encoding type used by the API to calculate offsets. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | x__xgafv: string, V1 error format. |
| 112 | Allowed values |
| 113 | 1 - v1 error format |
| 114 | 2 - v2 error format |
| 115 | |
| 116 | Returns: |
| 117 | An object of the form: |
| 118 | |
| 119 | { # The entity analysis response message. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 120 | "language": "A String", # 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 Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 121 | "entities": [ # The recognized entities in the input document. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 122 | { # 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. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 123 | "metadata": { # Metadata associated with the entity. Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are "wikipedia_url" and "mid", respectively. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 124 | "a_key": "A String", |
| 125 | }, |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 126 | "type": "A String", # The entity type. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 127 | "mentions": [ # The mentions of this entity in the input document. The API currently supports proper noun mentions. |
| 128 | { # Represents a mention for an entity in the text. Currently, proper noun mentions are supported. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 129 | "text": { # Represents an output piece of text. # The mention text. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 130 | "beginOffset": 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 Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 131 | "content": "A String", # The content of the output text. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 132 | }, |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 133 | "type": "A String", # The type of the entity mention. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 134 | }, |
| 135 | ], |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 136 | "name": "A String", # The representative name for the entity. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 137 | "salience": 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. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 138 | }, |
| 139 | ], |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 140 | }</pre> |
| 141 | </div> |
| 142 | |
| 143 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 144 | <code class="details" id="analyzeSentiment">analyzeSentiment(body=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 145 | <pre>Analyzes the sentiment of the provided text. |
| 146 | |
| 147 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 148 | body: object, The request body. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 149 | The object takes the form of: |
| 150 | |
| 151 | { # The sentiment analysis request message. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 152 | "document": { # ################################################################ # Represents the input to API methods. # Input document. |
| 153 | "language": "A String", # 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. |
| 154 | "gcsContentUri": "A String", # 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. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 155 | "content": "A String", # The content of the input in string format. Cloud audit logging exempt since it is based on user data. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 156 | "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 157 | }, |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 158 | "encodingType": "A String", # The encoding type used by the API to calculate sentence offsets for the sentence sentiment. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | x__xgafv: string, V1 error format. |
| 162 | Allowed values |
| 163 | 1 - v1 error format |
| 164 | 2 - v2 error format |
| 165 | |
| 166 | Returns: |
| 167 | An object of the form: |
| 168 | |
| 169 | { # The sentiment analysis response message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 170 | "sentences": [ # The sentiment for all the sentences in the document. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 171 | { # Represents a sentence in the input document. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 172 | "text": { # Represents an output piece of text. # The sentence text. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 173 | "beginOffset": 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 Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 174 | "content": "A String", # The content of the output text. |
| 175 | }, |
| 176 | "sentiment": { # 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. |
| 177 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment). |
| 178 | "polarity": 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. |
| 179 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative). |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 180 | }, |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 181 | }, |
| 182 | ], |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 183 | "language": "A String", # 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. |
| 184 | "documentSentiment": { # Represents the feeling associated with the entire text or entities in the text. # The overall sentiment of the input document. |
| 185 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment). |
| 186 | "polarity": 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. |
| 187 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative). |
| 188 | }, |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 189 | }</pre> |
| 190 | </div> |
| 191 | |
| 192 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 193 | <code class="details" id="analyzeSyntax">analyzeSyntax(body=None, x__xgafv=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 194 | <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 Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 195 | |
| 196 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 197 | body: object, The request body. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 198 | The object takes the form of: |
| 199 | |
| 200 | { # The syntax analysis request message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 201 | "encodingType": "A String", # The encoding type used by the API to calculate offsets. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 202 | "document": { # ################################################################ # Represents the input to API methods. # Input document. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 203 | "language": "A String", # 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. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 204 | "gcsContentUri": "A String", # 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. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 205 | "content": "A String", # The content of the input in string format. Cloud audit logging exempt since it is based on user data. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 206 | "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 207 | }, |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | x__xgafv: string, V1 error format. |
| 211 | Allowed values |
| 212 | 1 - v1 error format |
| 213 | 2 - v2 error format |
| 214 | |
| 215 | Returns: |
| 216 | An object of the form: |
| 217 | |
| 218 | { # The syntax analysis response message. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 219 | "sentences": [ # Sentences in the input document. |
| 220 | { # Represents a sentence in the input document. |
| 221 | "text": { # Represents an output piece of text. # The sentence text. |
| 222 | "beginOffset": 42, # The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request. |
| 223 | "content": "A String", # The content of the output text. |
| 224 | }, |
| 225 | "sentiment": { # 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. |
| 226 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment). |
| 227 | "polarity": 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. |
| 228 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative). |
| 229 | }, |
| 230 | }, |
| 231 | ], |
| 232 | "language": "A String", # 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 Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 233 | "tokens": [ # Tokens, along with their syntactic information, in the input document. |
| 234 | { # Represents the smallest syntactic building block of the text. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 235 | "dependencyEdge": { # Represents dependency parse tree information for a token. # Dependency tree parse for this token. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 236 | "headTokenIndex": 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. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 237 | "label": "A String", # The parse label for the token. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 238 | }, |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 239 | "lemma": "A String", # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 240 | "partOfSpeech": { # Represents part of speech information for a token. # Parts of speech tag for this token. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 241 | "tense": "A String", # The grammatical tense. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 242 | "aspect": "A String", # The grammatical aspect. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 243 | "voice": "A String", # The grammatical voice. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 244 | "gender": "A String", # The grammatical gender. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 245 | "proper": "A String", # The grammatical properness. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 246 | "tag": "A String", # The part of speech tag. |
| 247 | "mood": "A String", # The grammatical mood. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 248 | "number": "A String", # The grammatical number. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 249 | "case": "A String", # The grammatical case. |
| 250 | "person": "A String", # The grammatical person. |
| 251 | "form": "A String", # The grammatical form. |
| 252 | "reciprocity": "A String", # The grammatical reciprocity. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 253 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 254 | "text": { # Represents an output piece of text. # The token text. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 255 | "beginOffset": 42, # The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 256 | "content": "A String", # The content of the output text. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 257 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 258 | }, |
| 259 | ], |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 260 | }</pre> |
| 261 | </div> |
| 262 | |
| 263 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 264 | <code class="details" id="annotateText">annotateText(body=None, x__xgafv=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 265 | <pre>A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 266 | |
| 267 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 268 | body: object, The request body. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 269 | The object takes the form of: |
| 270 | |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 271 | { # The request message for the text annotation API, which can perform multiple analysis types (sentiment, entities, and syntax) in one call. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 272 | "document": { # ################################################################ # Represents the input to API methods. # Input document. |
| 273 | "language": "A String", # 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. |
| 274 | "gcsContentUri": "A String", # 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. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 275 | "content": "A String", # The content of the input in string format. Cloud audit logging exempt since it is based on user data. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 276 | "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 277 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 278 | "features": { # 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. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 279 | "extractDocumentSentiment": True or False, # Extract document-level sentiment. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 280 | "extractEntities": True or False, # Extract entities. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 281 | "extractSyntax": True or False, # Extract syntax information. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 282 | }, |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 283 | "encodingType": "A String", # The encoding type used by the API to calculate offsets. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | x__xgafv: string, V1 error format. |
| 287 | Allowed values |
| 288 | 1 - v1 error format |
| 289 | 2 - v2 error format |
| 290 | |
| 291 | Returns: |
| 292 | An object of the form: |
| 293 | |
| 294 | { # The text annotations response message. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 295 | "sentences": [ # Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax. |
| 296 | { # Represents a sentence in the input document. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 297 | "text": { # Represents an output piece of text. # The sentence text. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 298 | "beginOffset": 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 Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 299 | "content": "A String", # The content of the output text. |
| 300 | }, |
| 301 | "sentiment": { # 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. |
| 302 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment). |
| 303 | "polarity": 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. |
| 304 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative). |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 305 | }, |
| 306 | }, |
| 307 | ], |
| 308 | "documentSentiment": { # 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. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 309 | "score": 3.14, # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment). |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 310 | "polarity": 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. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 311 | "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative). |
| 312 | }, |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 313 | "entities": [ # Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities. |
| 314 | { # 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. |
| 315 | "metadata": { # Metadata associated with the entity. Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are "wikipedia_url" and "mid", respectively. |
| 316 | "a_key": "A String", |
| 317 | }, |
| 318 | "type": "A String", # The entity type. |
| 319 | "mentions": [ # The mentions of this entity in the input document. The API currently supports proper noun mentions. |
| 320 | { # Represents a mention for an entity in the text. Currently, proper noun mentions are supported. |
| 321 | "text": { # Represents an output piece of text. # The mention text. |
| 322 | "beginOffset": 42, # The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request. |
| 323 | "content": "A String", # The content of the output text. |
| 324 | }, |
| 325 | "type": "A String", # The type of the entity mention. |
| 326 | }, |
| 327 | ], |
| 328 | "name": "A String", # The representative name for the entity. |
| 329 | "salience": 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. |
| 330 | }, |
| 331 | ], |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 332 | "tokens": [ # Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 333 | { # Represents the smallest syntactic building block of the text. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 334 | "dependencyEdge": { # Represents dependency parse tree information for a token. # Dependency tree parse for this token. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 335 | "headTokenIndex": 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. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 336 | "label": "A String", # The parse label for the token. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 337 | }, |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 338 | "lemma": "A String", # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 339 | "partOfSpeech": { # Represents part of speech information for a token. # Parts of speech tag for this token. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 340 | "tense": "A String", # The grammatical tense. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 341 | "aspect": "A String", # The grammatical aspect. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 342 | "voice": "A String", # The grammatical voice. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 343 | "gender": "A String", # The grammatical gender. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 344 | "proper": "A String", # The grammatical properness. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 345 | "tag": "A String", # The part of speech tag. |
| 346 | "mood": "A String", # The grammatical mood. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 347 | "number": "A String", # The grammatical number. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 348 | "case": "A String", # The grammatical case. |
| 349 | "person": "A String", # The grammatical person. |
| 350 | "form": "A String", # The grammatical form. |
| 351 | "reciprocity": "A String", # The grammatical reciprocity. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 352 | }, |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 353 | "text": { # Represents an output piece of text. # The token text. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 354 | "beginOffset": 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 Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 355 | "content": "A String", # The content of the output text. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 356 | }, |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 357 | }, |
| 358 | ], |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 359 | "language": "A String", # 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 Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 360 | }</pre> |
| 361 | </div> |
| 362 | |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 363 | <div class="method"> |
| 364 | <code class="details" id="close">close()</code> |
| 365 | <pre>Close httplib2 connections.</pre> |
| 366 | </div> |
| 367 | |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 368 | </body></html> |