blob: 4df363c4be8cf85e56e1fae2336fb05defd34018 [file] [log] [blame]
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="language_v1beta1.html">Google Cloud Natural Language API</a> . <a href="language_v1beta1.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 finds proper names) in the text,</p>
80<p class="toc_element">
81 <code><a href="#analyzeSentiment">analyzeSentiment(body, x__xgafv=None)</a></code></p>
82<p class="firstline">Analyzes the sentiment of the provided text.</p>
83<p class="toc_element">
84 <code><a href="#annotateText">annotateText(body, x__xgafv=None)</a></code></p>
85<p class="firstline">Advanced API that analyzes the document and provides a full set of text</p>
86<h3>Method Details</h3>
87<div class="method">
88 <code class="details" id="analyzeEntities">analyzeEntities(body, x__xgafv=None)</code>
89 <pre>Finds named entities (currently finds proper names) in the text,
90entity types, salience, mentions for each entity, and other properties.
91
92Args:
93 body: object, The request body. (required)
94 The object takes the form of:
95
96{ # The entity analysis request message.
97 "document": { # ################################################################ # # Input document.
98 #
99 # Represents the input to API methods.
100 "content": "A String", # The content of the input in string format.
101 "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
102 # returns an `INVALID_ARGUMENT` error.
103 "language": "A String", # The language of the document (if not specified, the language is
104 # automatically detected). Both ISO and BCP-47 language codes are
105 # accepted.<br>
106 # **Current Language Restrictions:**
107 #
108 # * Only English, Spanish, and Japanese textual content
109 # are supported, with the following additional restriction:
110 # * `analyzeSentiment` only supports English text.
111 # If the language (either specified by the caller or automatically detected)
112 # is not supported by the called API method, an `INVALID_ARGUMENT` error
113 # is returned.
114 "gcsContentUri": "A String", # The Google Cloud Storage URI where the file content is located.
115 },
116 "encodingType": "A String", # 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 "entities": [ # The recognized entities in the input document.
129 { # Represents a phrase in the text that is a known entity, such as
130 # a person, an organization, or location. The API associates information, such
131 # as salience and mentions, with entities.
132 "type": "A String", # The entity type.
133 "mentions": [ # The mentions of this entity in the input document. The API currently
134 # supports proper noun mentions.
135 { # Represents a mention for an entity in the text. Currently, proper noun
136 # mentions are supported.
137 "text": { # Represents an output piece of text. # The mention text.
138 "content": "A String", # The content of the output text.
139 "beginOffset": 42, # The API calculates the beginning offset of the content in the original
140 # document according to the EncodingType specified in the API request.
141 },
142 },
143 ],
144 "salience": 3.14, # The salience score associated with the entity in the [0, 1.0] range.
145 #
146 # The salience score for an entity provides information about the
147 # importance or centrality of that entity to the entire document text.
148 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
149 # salient.
150 "name": "A String", # The representative name for the entity.
151 "metadata": { # Metadata associated with the entity.
152 #
153 # Currently, only Wikipedia URLs are provided, if available.
154 # The associated key is "wikipedia_url".
155 "a_key": "A String",
156 },
157 },
158 ],
159 "language": "A String", # The language of the text, which will be the same as the language specified
160 # in the request or, if not specified, the automatically-detected language.
161 }</pre>
162</div>
163
164<div class="method">
165 <code class="details" id="analyzeSentiment">analyzeSentiment(body, x__xgafv=None)</code>
166 <pre>Analyzes the sentiment of the provided text.
167
168Args:
169 body: object, The request body. (required)
170 The object takes the form of:
171
172{ # The sentiment analysis request message.
173 "document": { # ################################################################ # # Input document. Currently, `analyzeSentiment` only supports English text
174 # (Document.language="EN").
175 #
176 # Represents the input to API methods.
177 "content": "A String", # The content of the input in string format.
178 "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
179 # returns an `INVALID_ARGUMENT` error.
180 "language": "A String", # The language of the document (if not specified, the language is
181 # automatically detected). Both ISO and BCP-47 language codes are
182 # accepted.<br>
183 # **Current Language Restrictions:**
184 #
185 # * Only English, Spanish, and Japanese textual content
186 # are supported, with the following additional restriction:
187 # * `analyzeSentiment` only supports English text.
188 # If the language (either specified by the caller or automatically detected)
189 # is not supported by the called API method, an `INVALID_ARGUMENT` error
190 # is returned.
191 "gcsContentUri": "A String", # The Google Cloud Storage URI where the file content is located.
192 },
193 }
194
195 x__xgafv: string, V1 error format.
196 Allowed values
197 1 - v1 error format
198 2 - v2 error format
199
200Returns:
201 An object of the form:
202
203 { # The sentiment analysis response message.
204 "documentSentiment": { # Represents the feeling associated with the entire text or entities in # The overall sentiment of the input document.
205 # the text.
206 "polarity": 3.14, # Polarity of the sentiment in the [-1.0, 1.0] range. Larger numbers
207 # represent more positive sentiments.
208 "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents
209 # the absolute magnitude of sentiment regardless of polarity (positive or
210 # negative).
211 },
212 "language": "A String", # The language of the text, which will be the same as the language specified
213 # in the request or, if not specified, the automatically-detected language.
214 }</pre>
215</div>
216
217<div class="method">
218 <code class="details" id="annotateText">annotateText(body, x__xgafv=None)</code>
219 <pre>Advanced API that analyzes the document and provides a full set of text
220annotations, including semantic, syntactic, and sentiment information. This
221API is intended for users who are familiar with machine learning and need
222in-depth text features to build upon.
223
224Args:
225 body: object, The request body. (required)
226 The object takes the form of:
227
228{ # The request message for the advanced text annotation API, which performs all
229 # the above plus syntactic analysis.
230 "document": { # ################################################################ # # Input document.
231 #
232 # Represents the input to API methods.
233 "content": "A String", # The content of the input in string format.
234 "type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
235 # returns an `INVALID_ARGUMENT` error.
236 "language": "A String", # The language of the document (if not specified, the language is
237 # automatically detected). Both ISO and BCP-47 language codes are
238 # accepted.<br>
239 # **Current Language Restrictions:**
240 #
241 # * Only English, Spanish, and Japanese textual content
242 # are supported, with the following additional restriction:
243 # * `analyzeSentiment` only supports English text.
244 # If the language (either specified by the caller or automatically detected)
245 # is not supported by the called API method, an `INVALID_ARGUMENT` error
246 # is returned.
247 "gcsContentUri": "A String", # The Google Cloud Storage URI where the file content is located.
248 },
249 "encodingType": "A String", # The encoding type used by the API to calculate offsets.
250 "features": { # All available features for sentiment, syntax, and semantic analysis. # The enabled features.
251 # Setting each one to true will enable that specific analysis for the input.
252 "extractSyntax": True or False, # Extract syntax information.
253 "extractEntities": True or False, # Extract entities.
254 "extractDocumentSentiment": True or False, # Extract document-level sentiment.
255 },
256 }
257
258 x__xgafv: string, V1 error format.
259 Allowed values
260 1 - v1 error format
261 2 - v2 error format
262
263Returns:
264 An object of the form:
265
266 { # The text annotations response message.
267 "tokens": [ # Tokens, along with their syntactic information, in the input document.
268 # Populated if the user enables
269 # AnnotateTextRequest.Features.extract_syntax.
270 { # Represents the smallest syntactic building block of the text.
271 "text": { # Represents an output piece of text. # The token text.
272 "content": "A String", # The content of the output text.
273 "beginOffset": 42, # The API calculates the beginning offset of the content in the original
274 # document according to the EncodingType specified in the API request.
275 },
276 "dependencyEdge": { # Represents dependency parse tree information for a token. # Dependency tree parse for this token.
277 "headTokenIndex": 42, # Represents the head of this token in the dependency tree.
278 # This is the index of the token which has an arc going to this token.
279 # The index is the position of the token in the array of tokens returned
280 # by the API method. If this token is a root token, then the
281 # `head_token_index` is its own index.
282 "label": "A String", # The parse label for the token.
283 },
284 "partOfSpeech": { # Represents part of speech information for a token. # Parts of speech tag for this token.
285 "tag": "A String", # The part of speech tag.
286 },
287 "lemma": "A String", # [Lemma](https://en.wikipedia.org/wiki/Lemma_(morphology))
288 # of the token.
289 },
290 ],
291 "entities": [ # Entities, along with their semantic information, in the input document.
292 # Populated if the user enables
293 # AnnotateTextRequest.Features.extract_entities.
294 { # Represents a phrase in the text that is a known entity, such as
295 # a person, an organization, or location. The API associates information, such
296 # as salience and mentions, with entities.
297 "type": "A String", # The entity type.
298 "mentions": [ # The mentions of this entity in the input document. The API currently
299 # supports proper noun mentions.
300 { # Represents a mention for an entity in the text. Currently, proper noun
301 # mentions are supported.
302 "text": { # Represents an output piece of text. # The mention text.
303 "content": "A String", # The content of the output text.
304 "beginOffset": 42, # The API calculates the beginning offset of the content in the original
305 # document according to the EncodingType specified in the API request.
306 },
307 },
308 ],
309 "salience": 3.14, # The salience score associated with the entity in the [0, 1.0] range.
310 #
311 # The salience score for an entity provides information about the
312 # importance or centrality of that entity to the entire document text.
313 # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
314 # salient.
315 "name": "A String", # The representative name for the entity.
316 "metadata": { # Metadata associated with the entity.
317 #
318 # Currently, only Wikipedia URLs are provided, if available.
319 # The associated key is "wikipedia_url".
320 "a_key": "A String",
321 },
322 },
323 ],
324 "documentSentiment": { # Represents the feeling associated with the entire text or entities in # The overall sentiment for the document. Populated if the user enables
325 # AnnotateTextRequest.Features.extract_document_sentiment.
326 # the text.
327 "polarity": 3.14, # Polarity of the sentiment in the [-1.0, 1.0] range. Larger numbers
328 # represent more positive sentiments.
329 "magnitude": 3.14, # A non-negative number in the [0, +inf) range, which represents
330 # the absolute magnitude of sentiment regardless of polarity (positive or
331 # negative).
332 },
333 "language": "A String", # The language of the text, which will be the same as the language specified
334 # in the request or, if not specified, the automatically-detected language.
335 "sentences": [ # Sentences in the input document. Populated if the user enables
336 # AnnotateTextRequest.Features.extract_syntax.
337 { # Represents a sentence in the input document.
338 "text": { # Represents an output piece of text. # The sentence text.
339 "content": "A String", # The content of the output text.
340 "beginOffset": 42, # The API calculates the beginning offset of the content in the original
341 # document according to the EncodingType specified in the API request.
342 },
343 },
344 ],
345 }</pre>
346</div>
347
348</body></html>