OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis_beta.language.v1beta1; | 3 library googleapis_beta.language.v1beta1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 "POST", | 112 "POST", |
113 body: _body, | 113 body: _body, |
114 queryParams: _queryParams, | 114 queryParams: _queryParams, |
115 uploadOptions: _uploadOptions, | 115 uploadOptions: _uploadOptions, |
116 uploadMedia: _uploadMedia, | 116 uploadMedia: _uploadMedia, |
117 downloadOptions: _downloadOptions); | 117 downloadOptions: _downloadOptions); |
118 return _response.then((data) => new AnalyzeSentimentResponse.fromJson(data))
; | 118 return _response.then((data) => new AnalyzeSentimentResponse.fromJson(data))
; |
119 } | 119 } |
120 | 120 |
121 /** | 121 /** |
122 * Advanced API that analyzes the document and provides a full set of text | 122 * A convenience method that provides all the features that analyzeSentiment, |
123 * annotations, including semantic, syntactic, and sentiment information. This | 123 * analyzeEntities, and analyzeSyntax provide in one call. |
124 * API is intended for users who are familiar with machine learning and need | |
125 * in-depth text features to build upon. | |
126 * | 124 * |
127 * [request] - The metadata request object. | 125 * [request] - The metadata request object. |
128 * | 126 * |
129 * Request parameters: | 127 * Request parameters: |
130 * | 128 * |
131 * Completes with a [AnnotateTextResponse]. | 129 * Completes with a [AnnotateTextResponse]. |
132 * | 130 * |
133 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 131 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
134 * error. | 132 * error. |
135 * | 133 * |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 210 } |
213 } | 211 } |
214 | 212 |
215 /** The entity analysis response message. */ | 213 /** The entity analysis response message. */ |
216 class AnalyzeEntitiesResponse { | 214 class AnalyzeEntitiesResponse { |
217 /** The recognized entities in the input document. */ | 215 /** The recognized entities in the input document. */ |
218 core.List<Entity> entities; | 216 core.List<Entity> entities; |
219 /** | 217 /** |
220 * The language of the text, which will be the same as the language specified | 218 * The language of the text, which will be the same as the language specified |
221 * in the request or, if not specified, the automatically-detected language. | 219 * in the request or, if not specified, the automatically-detected language. |
| 220 * See Document.language field for more details. |
222 */ | 221 */ |
223 core.String language; | 222 core.String language; |
224 | 223 |
225 AnalyzeEntitiesResponse(); | 224 AnalyzeEntitiesResponse(); |
226 | 225 |
227 AnalyzeEntitiesResponse.fromJson(core.Map _json) { | 226 AnalyzeEntitiesResponse.fromJson(core.Map _json) { |
228 if (_json.containsKey("entities")) { | 227 if (_json.containsKey("entities")) { |
229 entities = _json["entities"].map((value) => new Entity.fromJson(value)).to
List(); | 228 entities = _json["entities"].map((value) => new Entity.fromJson(value)).to
List(); |
230 } | 229 } |
231 if (_json.containsKey("language")) { | 230 if (_json.containsKey("language")) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 _json["documentSentiment"] = (documentSentiment).toJson(); | 296 _json["documentSentiment"] = (documentSentiment).toJson(); |
298 } | 297 } |
299 if (language != null) { | 298 if (language != null) { |
300 _json["language"] = language; | 299 _json["language"] = language; |
301 } | 300 } |
302 return _json; | 301 return _json; |
303 } | 302 } |
304 } | 303 } |
305 | 304 |
306 /** | 305 /** |
307 * The request message for the advanced text annotation API, which performs all | 306 * The request message for the text annotation API, which can perform multiple |
308 * the above plus syntactic analysis. | 307 * analysis types (sentiment, entities, and syntax) in one call. |
309 */ | 308 */ |
310 class AnnotateTextRequest { | 309 class AnnotateTextRequest { |
311 /** Input document. */ | 310 /** Input document. */ |
312 Document document; | 311 Document document; |
313 /** | 312 /** |
314 * The encoding type used by the API to calculate offsets. | 313 * The encoding type used by the API to calculate offsets. |
315 * Possible string values are: | 314 * Possible string values are: |
316 * - "NONE" : If `EncodingType` is not specified, encoding-dependent | 315 * - "NONE" : If `EncodingType` is not specified, encoding-dependent |
317 * information (such as | 316 * information (such as |
318 * `begin_offset`) will be set at `-1`. | 317 * `begin_offset`) will be set at `-1`. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 Sentiment documentSentiment; | 370 Sentiment documentSentiment; |
372 /** | 371 /** |
373 * Entities, along with their semantic information, in the input document. | 372 * Entities, along with their semantic information, in the input document. |
374 * Populated if the user enables | 373 * Populated if the user enables |
375 * AnnotateTextRequest.Features.extract_entities. | 374 * AnnotateTextRequest.Features.extract_entities. |
376 */ | 375 */ |
377 core.List<Entity> entities; | 376 core.List<Entity> entities; |
378 /** | 377 /** |
379 * The language of the text, which will be the same as the language specified | 378 * The language of the text, which will be the same as the language specified |
380 * in the request or, if not specified, the automatically-detected language. | 379 * in the request or, if not specified, the automatically-detected language. |
| 380 * See Document.language field for more details. |
381 */ | 381 */ |
382 core.String language; | 382 core.String language; |
383 /** | 383 /** |
384 * Sentences in the input document. Populated if the user enables | 384 * Sentences in the input document. Populated if the user enables |
385 * AnnotateTextRequest.Features.extract_syntax. | 385 * AnnotateTextRequest.Features.extract_syntax. |
386 */ | 386 */ |
387 core.List<Sentence> sentences; | 387 core.List<Sentence> sentences; |
388 /** | 388 /** |
389 * Tokens, along with their syntactic information, in the input document. | 389 * Tokens, along with their syntactic information, in the input document. |
390 * Populated if the user enables | 390 * Populated if the user enables |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 * the text. | 835 * the text. |
836 */ | 836 */ |
837 class Sentiment { | 837 class Sentiment { |
838 /** | 838 /** |
839 * A non-negative number in the [0, +inf) range, which represents | 839 * A non-negative number in the [0, +inf) range, which represents |
840 * the absolute magnitude of sentiment regardless of polarity (positive or | 840 * the absolute magnitude of sentiment regardless of polarity (positive or |
841 * negative). | 841 * negative). |
842 */ | 842 */ |
843 core.double magnitude; | 843 core.double magnitude; |
844 /** | 844 /** |
845 * Polarity of the sentiment in the [-1.0, 1.0] range. Larger numbers | 845 * DEPRECATED FIELD - This field is being deprecated in |
846 * represent more positive sentiments. | 846 * favor of score. Please refer to our documentation at |
| 847 * https://cloud.google.com/natural-language/docs for more information. |
847 */ | 848 */ |
848 core.double polarity; | 849 core.double polarity; |
849 | 850 |
850 Sentiment(); | 851 Sentiment(); |
851 | 852 |
852 Sentiment.fromJson(core.Map _json) { | 853 Sentiment.fromJson(core.Map _json) { |
853 if (_json.containsKey("magnitude")) { | 854 if (_json.containsKey("magnitude")) { |
854 magnitude = _json["magnitude"]; | 855 magnitude = _json["magnitude"]; |
855 } | 856 } |
856 if (_json.containsKey("polarity")) { | 857 if (_json.containsKey("polarity")) { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 } | 1048 } |
1048 if (partOfSpeech != null) { | 1049 if (partOfSpeech != null) { |
1049 _json["partOfSpeech"] = (partOfSpeech).toJson(); | 1050 _json["partOfSpeech"] = (partOfSpeech).toJson(); |
1050 } | 1051 } |
1051 if (text != null) { | 1052 if (text != null) { |
1052 _json["text"] = (text).toJson(); | 1053 _json["text"] = (text).toJson(); |
1053 } | 1054 } |
1054 return _json; | 1055 return _json; |
1055 } | 1056 } |
1056 } | 1057 } |
OLD | NEW |