aws-sdk-comprehend 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b49bd201976b4b4a773114b17e5f28732293da89
4
+ data.tar.gz: 481bb8f7a54769df38969c7a01785e2a4fbf7ce6
5
+ SHA512:
6
+ metadata.gz: bccf8aa24be1f8c6c04d9a10c7d72ff205224da711cb60786e15e18a3c102daa069a679351533c68502e53f31b3e1a1c24cf15beb6fd90cfa793494990ed99e3
7
+ data.tar.gz: 8d4235972d9102c417efd0d7e85a60f611a6215188c62ce9a8bcfd85c140304e117ab8b960044d81cdd7c8dd8a119819c151446a1ae4e5926fb15b8139fe61cb
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core'
9
+ require 'aws-sigv4'
10
+
11
+ require_relative 'aws-sdk-comprehend/types'
12
+ require_relative 'aws-sdk-comprehend/client_api'
13
+ require_relative 'aws-sdk-comprehend/client'
14
+ require_relative 'aws-sdk-comprehend/errors'
15
+ require_relative 'aws-sdk-comprehend/resource'
16
+ require_relative 'aws-sdk-comprehend/customizations'
17
+
18
+ # This module provides support for Amazon Comprehend. This module is available in the
19
+ # `aws-sdk-comprehend` gem.
20
+ #
21
+ # # Client
22
+ #
23
+ # The {Client} class provides one method for each API operation. Operation
24
+ # methods each accept a hash of request parameters and return a response
25
+ # structure.
26
+ #
27
+ # See {Client} for more information.
28
+ #
29
+ # # Errors
30
+ #
31
+ # Errors returned from Amazon Comprehend all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::Comprehend::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::Comprehend
44
+
45
+ GEM_VERSION = '1.0.0'
46
+
47
+ end
@@ -0,0 +1,715 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/response_paging.rb'
19
+ require 'aws-sdk-core/plugins/stub_responses.rb'
20
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
21
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
22
+ require 'aws-sdk-core/plugins/signature_v4.rb'
23
+ require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
24
+
25
+ Aws::Plugins::GlobalConfiguration.add_identifier(:comprehend)
26
+
27
+ module Aws::Comprehend
28
+ class Client < Seahorse::Client::Base
29
+
30
+ include Aws::ClientStubs
31
+
32
+ @identifier = :comprehend
33
+
34
+ set_api(ClientApi::API)
35
+
36
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
37
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
38
+ add_plugin(Aws::Plugins::Logging)
39
+ add_plugin(Aws::Plugins::ParamConverter)
40
+ add_plugin(Aws::Plugins::ParamValidator)
41
+ add_plugin(Aws::Plugins::UserAgent)
42
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
43
+ add_plugin(Aws::Plugins::RetryErrors)
44
+ add_plugin(Aws::Plugins::GlobalConfiguration)
45
+ add_plugin(Aws::Plugins::RegionalEndpoint)
46
+ add_plugin(Aws::Plugins::ResponsePaging)
47
+ add_plugin(Aws::Plugins::StubResponses)
48
+ add_plugin(Aws::Plugins::IdempotencyToken)
49
+ add_plugin(Aws::Plugins::JsonvalueConverter)
50
+ add_plugin(Aws::Plugins::SignatureV4)
51
+ add_plugin(Aws::Plugins::Protocols::JsonRpc)
52
+
53
+ # @option options [required, Aws::CredentialProvider] :credentials
54
+ # Your AWS credentials. This can be an instance of any one of the
55
+ # following classes:
56
+ #
57
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
58
+ # credentials.
59
+ #
60
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
61
+ # from an EC2 IMDS on an EC2 instance.
62
+ #
63
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
64
+ # shared file, such as `~/.aws/config`.
65
+ #
66
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
67
+ #
68
+ # When `:credentials` are not configured directly, the following
69
+ # locations will be searched for credentials:
70
+ #
71
+ # * `Aws.config[:credentials]`
72
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
73
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
74
+ # * `~/.aws/credentials`
75
+ # * `~/.aws/config`
76
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
77
+ # very aggressive. Construct and pass an instance of
78
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
79
+ # timeouts.
80
+ #
81
+ # @option options [required, String] :region
82
+ # The AWS region to connect to. The configured `:region` is
83
+ # used to determine the service `:endpoint`. When not passed,
84
+ # a default `:region` is search for in the following locations:
85
+ #
86
+ # * `Aws.config[:region]`
87
+ # * `ENV['AWS_REGION']`
88
+ # * `ENV['AMAZON_REGION']`
89
+ # * `ENV['AWS_DEFAULT_REGION']`
90
+ # * `~/.aws/credentials`
91
+ # * `~/.aws/config`
92
+ #
93
+ # @option options [String] :access_key_id
94
+ #
95
+ # @option options [Boolean] :convert_params (true)
96
+ # When `true`, an attempt is made to coerce request parameters into
97
+ # the required types.
98
+ #
99
+ # @option options [String] :endpoint
100
+ # The client endpoint is normally constructed from the `:region`
101
+ # option. You should only configure an `:endpoint` when connecting
102
+ # to test endpoints. This should be avalid HTTP(S) URI.
103
+ #
104
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
105
+ # The log formatter.
106
+ #
107
+ # @option options [Symbol] :log_level (:info)
108
+ # The log level to send messages to the `:logger` at.
109
+ #
110
+ # @option options [Logger] :logger
111
+ # The Logger instance to send log messages to. If this option
112
+ # is not set, logging will be disabled.
113
+ #
114
+ # @option options [String] :profile ("default")
115
+ # Used when loading credentials from the shared credentials file
116
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
117
+ #
118
+ # @option options [Integer] :retry_limit (3)
119
+ # The maximum number of times to retry failed requests. Only
120
+ # ~ 500 level server errors and certain ~ 400 level client errors
121
+ # are retried. Generally, these are throttling errors, data
122
+ # checksum errors, networking errors, timeout errors and auth
123
+ # errors from expired credentials.
124
+ #
125
+ # @option options [String] :secret_access_key
126
+ #
127
+ # @option options [String] :session_token
128
+ #
129
+ # @option options [Boolean] :simple_json (false)
130
+ # Disables request parameter conversion, validation, and formatting.
131
+ # Also disable response data type conversions. This option is useful
132
+ # when you want to ensure the highest level of performance by
133
+ # avoiding overhead of walking request parameters and response data
134
+ # structures.
135
+ #
136
+ # When `:simple_json` is enabled, the request parameters hash must
137
+ # be formatted exactly as the DynamoDB API expects.
138
+ #
139
+ # @option options [Boolean] :stub_responses (false)
140
+ # Causes the client to return stubbed responses. By default
141
+ # fake responses are generated and returned. You can specify
142
+ # the response data to return or errors to raise by calling
143
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
144
+ #
145
+ # ** Please note ** When response stubbing is enabled, no HTTP
146
+ # requests are made, and retries are disabled.
147
+ #
148
+ # @option options [Boolean] :validate_params (true)
149
+ # When `true`, request parameters are validated before
150
+ # sending the request.
151
+ #
152
+ def initialize(*args)
153
+ super
154
+ end
155
+
156
+ # @!group API Operations
157
+
158
+ # Determines the dominant language of the input text for a batch of
159
+ # documents. For a list of languages that Amazon Comprehend can detect,
160
+ # see [Amazon Comprehend Supported Languages][1].
161
+ #
162
+ #
163
+ #
164
+ # [1]: http://docs.aws.amazon.com/comprehend/latest/dg/how-languages.html
165
+ #
166
+ # @option params [required, Array<String>] :text_list
167
+ # A list containing the text of the input documents. The list can
168
+ # contain a maximum of 25 documents. Each document should contain at
169
+ # least 20 characters and must contain fewer than 5,000 bytes of UTF-8
170
+ # encoded characters.
171
+ #
172
+ # @return [Types::BatchDetectDominantLanguageResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
173
+ #
174
+ # * {Types::BatchDetectDominantLanguageResponse#result_list #result_list} => Array&lt;Types::BatchDetectDominantLanguageItemResult&gt;
175
+ # * {Types::BatchDetectDominantLanguageResponse#error_list #error_list} => Array&lt;Types::BatchItemError&gt;
176
+ #
177
+ # @example Request syntax with placeholder values
178
+ #
179
+ # resp = client.batch_detect_dominant_language({
180
+ # text_list: ["String"], # required
181
+ # })
182
+ #
183
+ # @example Response structure
184
+ #
185
+ # resp.result_list #=> Array
186
+ # resp.result_list[0].index #=> Integer
187
+ # resp.result_list[0].languages #=> Array
188
+ # resp.result_list[0].languages[0].language_code #=> String
189
+ # resp.result_list[0].languages[0].score #=> Float
190
+ # resp.error_list #=> Array
191
+ # resp.error_list[0].index #=> Integer
192
+ # resp.error_list[0].error_code #=> String
193
+ # resp.error_list[0].error_message #=> String
194
+ #
195
+ # @see http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/BatchDetectDominantLanguage AWS API Documentation
196
+ #
197
+ # @overload batch_detect_dominant_language(params = {})
198
+ # @param [Hash] params ({})
199
+ def batch_detect_dominant_language(params = {}, options = {})
200
+ req = build_request(:batch_detect_dominant_language, params)
201
+ req.send_request(options)
202
+ end
203
+
204
+ # Inspects the text of a batch of documents and returns information
205
+ # about them. For more information about entities, see how-entities
206
+ #
207
+ # @option params [required, Array<String>] :text_list
208
+ # A list containing the text of the input documents. The list can
209
+ # contain a maximum of 25 documents. Each document must contain fewer
210
+ # than 5,000 bytes of UTF-8 encoded characters.
211
+ #
212
+ # @option params [required, String] :language_code
213
+ # The language of the input documents. All documents must be in the same
214
+ # language.
215
+ #
216
+ # @return [Types::BatchDetectEntitiesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
217
+ #
218
+ # * {Types::BatchDetectEntitiesResponse#result_list #result_list} => Array&lt;Types::BatchDetectEntitiesItemResult&gt;
219
+ # * {Types::BatchDetectEntitiesResponse#error_list #error_list} => Array&lt;Types::BatchItemError&gt;
220
+ #
221
+ # @example Request syntax with placeholder values
222
+ #
223
+ # resp = client.batch_detect_entities({
224
+ # text_list: ["String"], # required
225
+ # language_code: "String", # required
226
+ # })
227
+ #
228
+ # @example Response structure
229
+ #
230
+ # resp.result_list #=> Array
231
+ # resp.result_list[0].index #=> Integer
232
+ # resp.result_list[0].entities #=> Array
233
+ # resp.result_list[0].entities[0].score #=> Float
234
+ # resp.result_list[0].entities[0].type #=> String, one of "PERSON", "LOCATION", "ORGANIZATION", "COMMERCIAL_ITEM", "EVENT", "DATE", "QUANTITY", "TITLE", "OTHER"
235
+ # resp.result_list[0].entities[0].text #=> String
236
+ # resp.result_list[0].entities[0].begin_offset #=> Integer
237
+ # resp.result_list[0].entities[0].end_offset #=> Integer
238
+ # resp.error_list #=> Array
239
+ # resp.error_list[0].index #=> Integer
240
+ # resp.error_list[0].error_code #=> String
241
+ # resp.error_list[0].error_message #=> String
242
+ #
243
+ # @see http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/BatchDetectEntities AWS API Documentation
244
+ #
245
+ # @overload batch_detect_entities(params = {})
246
+ # @param [Hash] params ({})
247
+ def batch_detect_entities(params = {}, options = {})
248
+ req = build_request(:batch_detect_entities, params)
249
+ req.send_request(options)
250
+ end
251
+
252
+ # Detects the key noun phrases found in a batch of documents.
253
+ #
254
+ # @option params [required, Array<String>] :text_list
255
+ # A list containing the text of the input documents. The list can
256
+ # contain a maximum of 25 documents. Each document must contain fewer
257
+ # that 5,000 bytes of UTF-8 encoded characters.
258
+ #
259
+ # @option params [required, String] :language_code
260
+ # The language of the input documents. All documents must be in the same
261
+ # language.
262
+ #
263
+ # @return [Types::BatchDetectKeyPhrasesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
264
+ #
265
+ # * {Types::BatchDetectKeyPhrasesResponse#result_list #result_list} => Array&lt;Types::BatchDetectKeyPhrasesItemResult&gt;
266
+ # * {Types::BatchDetectKeyPhrasesResponse#error_list #error_list} => Array&lt;Types::BatchItemError&gt;
267
+ #
268
+ # @example Request syntax with placeholder values
269
+ #
270
+ # resp = client.batch_detect_key_phrases({
271
+ # text_list: ["String"], # required
272
+ # language_code: "String", # required
273
+ # })
274
+ #
275
+ # @example Response structure
276
+ #
277
+ # resp.result_list #=> Array
278
+ # resp.result_list[0].index #=> Integer
279
+ # resp.result_list[0].key_phrases #=> Array
280
+ # resp.result_list[0].key_phrases[0].score #=> Float
281
+ # resp.result_list[0].key_phrases[0].text #=> String
282
+ # resp.result_list[0].key_phrases[0].begin_offset #=> Integer
283
+ # resp.result_list[0].key_phrases[0].end_offset #=> Integer
284
+ # resp.error_list #=> Array
285
+ # resp.error_list[0].index #=> Integer
286
+ # resp.error_list[0].error_code #=> String
287
+ # resp.error_list[0].error_message #=> String
288
+ #
289
+ # @see http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/BatchDetectKeyPhrases AWS API Documentation
290
+ #
291
+ # @overload batch_detect_key_phrases(params = {})
292
+ # @param [Hash] params ({})
293
+ def batch_detect_key_phrases(params = {}, options = {})
294
+ req = build_request(:batch_detect_key_phrases, params)
295
+ req.send_request(options)
296
+ end
297
+
298
+ # Inspects a batch of documents and returns an inference of the
299
+ # prevailing sentiment, `POSITIVE`, `NEUTRAL`, `MIXED`, or `NEGATIVE`,
300
+ # in each one.
301
+ #
302
+ # @option params [required, Array<String>] :text_list
303
+ # A list containing the text of the input documents. The list can
304
+ # contain a maximum of 25 documents. Each document must contain fewer
305
+ # that 5,000 bytes of UTF-8 encoded characters.
306
+ #
307
+ # @option params [required, String] :language_code
308
+ # The language of the input documents. All documents must be in the same
309
+ # language.
310
+ #
311
+ # @return [Types::BatchDetectSentimentResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
312
+ #
313
+ # * {Types::BatchDetectSentimentResponse#result_list #result_list} => Array&lt;Types::BatchDetectSentimentItemResult&gt;
314
+ # * {Types::BatchDetectSentimentResponse#error_list #error_list} => Array&lt;Types::BatchItemError&gt;
315
+ #
316
+ # @example Request syntax with placeholder values
317
+ #
318
+ # resp = client.batch_detect_sentiment({
319
+ # text_list: ["String"], # required
320
+ # language_code: "String", # required
321
+ # })
322
+ #
323
+ # @example Response structure
324
+ #
325
+ # resp.result_list #=> Array
326
+ # resp.result_list[0].index #=> Integer
327
+ # resp.result_list[0].sentiment #=> String, one of "POSITIVE", "NEGATIVE", "NEUTRAL", "MIXED"
328
+ # resp.result_list[0].sentiment_score.positive #=> Float
329
+ # resp.result_list[0].sentiment_score.negative #=> Float
330
+ # resp.result_list[0].sentiment_score.neutral #=> Float
331
+ # resp.result_list[0].sentiment_score.mixed #=> Float
332
+ # resp.error_list #=> Array
333
+ # resp.error_list[0].index #=> Integer
334
+ # resp.error_list[0].error_code #=> String
335
+ # resp.error_list[0].error_message #=> String
336
+ #
337
+ # @see http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/BatchDetectSentiment AWS API Documentation
338
+ #
339
+ # @overload batch_detect_sentiment(params = {})
340
+ # @param [Hash] params ({})
341
+ def batch_detect_sentiment(params = {}, options = {})
342
+ req = build_request(:batch_detect_sentiment, params)
343
+ req.send_request(options)
344
+ end
345
+
346
+ # Gets the properties associated with a topic detection job. Use this
347
+ # operation to get the status of a detection job.
348
+ #
349
+ # @option params [required, String] :job_id
350
+ # The identifier assigned by the user to the detection job.
351
+ #
352
+ # @return [Types::DescribeTopicsDetectionJobResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
353
+ #
354
+ # * {Types::DescribeTopicsDetectionJobResponse#topics_detection_job_properties #topics_detection_job_properties} => Types::TopicsDetectionJobProperties
355
+ #
356
+ # @example Request syntax with placeholder values
357
+ #
358
+ # resp = client.describe_topics_detection_job({
359
+ # job_id: "JobId", # required
360
+ # })
361
+ #
362
+ # @example Response structure
363
+ #
364
+ # resp.topics_detection_job_properties.job_id #=> String
365
+ # resp.topics_detection_job_properties.job_name #=> String
366
+ # resp.topics_detection_job_properties.job_status #=> String, one of "SUBMITTED", "IN_PROGRESS", "COMPLETED", "FAILED"
367
+ # resp.topics_detection_job_properties.message #=> String
368
+ # resp.topics_detection_job_properties.submit_time #=> Time
369
+ # resp.topics_detection_job_properties.end_time #=> Time
370
+ # resp.topics_detection_job_properties.input_data_config.s3_uri #=> String
371
+ # resp.topics_detection_job_properties.input_data_config.input_format #=> String, one of "ONE_DOC_PER_FILE", "ONE_DOC_PER_LINE"
372
+ # resp.topics_detection_job_properties.output_data_config.s3_uri #=> String
373
+ # resp.topics_detection_job_properties.number_of_topics #=> Integer
374
+ #
375
+ # @see http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/DescribeTopicsDetectionJob AWS API Documentation
376
+ #
377
+ # @overload describe_topics_detection_job(params = {})
378
+ # @param [Hash] params ({})
379
+ def describe_topics_detection_job(params = {}, options = {})
380
+ req = build_request(:describe_topics_detection_job, params)
381
+ req.send_request(options)
382
+ end
383
+
384
+ # Determines the dominant language of the input text. For a list of
385
+ # languages that Amazon Comprehend can detect, see [Amazon Comprehend
386
+ # Supported Languages][1].
387
+ #
388
+ #
389
+ #
390
+ # [1]: http://docs.aws.amazon.com/comprehend/latest/dg/how-languages.html
391
+ #
392
+ # @option params [required, String] :text
393
+ # A UTF-8 text string. Each string should contain at least 20 characters
394
+ # and must contain fewer that 5,000 bytes of UTF-8 encoded characters.
395
+ #
396
+ # @return [Types::DetectDominantLanguageResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
397
+ #
398
+ # * {Types::DetectDominantLanguageResponse#languages #languages} => Array&lt;Types::DominantLanguage&gt;
399
+ #
400
+ # @example Request syntax with placeholder values
401
+ #
402
+ # resp = client.detect_dominant_language({
403
+ # text: "String", # required
404
+ # })
405
+ #
406
+ # @example Response structure
407
+ #
408
+ # resp.languages #=> Array
409
+ # resp.languages[0].language_code #=> String
410
+ # resp.languages[0].score #=> Float
411
+ #
412
+ # @see http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/DetectDominantLanguage AWS API Documentation
413
+ #
414
+ # @overload detect_dominant_language(params = {})
415
+ # @param [Hash] params ({})
416
+ def detect_dominant_language(params = {}, options = {})
417
+ req = build_request(:detect_dominant_language, params)
418
+ req.send_request(options)
419
+ end
420
+
421
+ # Inspects text for entities, and returns information about them. For
422
+ # more information, about entities, see how-entities.
423
+ #
424
+ # @option params [required, String] :text
425
+ # A UTF-8 text string. Each string must contain fewer that 5,000 bytes
426
+ # of UTF-8 encoded characters.
427
+ #
428
+ # @option params [required, String] :language_code
429
+ # The RFC 5646 language code of the input text. If the request does not
430
+ # specify the language code, the service detects the dominant language.
431
+ # If you specify a language code that the service does not support, it
432
+ # returns `UnsupportedLanguageException` exception. For more information
433
+ # about RFC 5646, see [Tags for Identifying Languages][1] on the *IETF
434
+ # Tools* web site.
435
+ #
436
+ #
437
+ #
438
+ # [1]: https://tools.ietf.org/html/rfc5646
439
+ #
440
+ # @return [Types::DetectEntitiesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
441
+ #
442
+ # * {Types::DetectEntitiesResponse#entities #entities} => Array&lt;Types::Entity&gt;
443
+ #
444
+ # @example Request syntax with placeholder values
445
+ #
446
+ # resp = client.detect_entities({
447
+ # text: "String", # required
448
+ # language_code: "en", # required, accepts en, es
449
+ # })
450
+ #
451
+ # @example Response structure
452
+ #
453
+ # resp.entities #=> Array
454
+ # resp.entities[0].score #=> Float
455
+ # resp.entities[0].type #=> String, one of "PERSON", "LOCATION", "ORGANIZATION", "COMMERCIAL_ITEM", "EVENT", "DATE", "QUANTITY", "TITLE", "OTHER"
456
+ # resp.entities[0].text #=> String
457
+ # resp.entities[0].begin_offset #=> Integer
458
+ # resp.entities[0].end_offset #=> Integer
459
+ #
460
+ # @see http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/DetectEntities AWS API Documentation
461
+ #
462
+ # @overload detect_entities(params = {})
463
+ # @param [Hash] params ({})
464
+ def detect_entities(params = {}, options = {})
465
+ req = build_request(:detect_entities, params)
466
+ req.send_request(options)
467
+ end
468
+
469
+ # Detects the key noun phrases found in the text.
470
+ #
471
+ # @option params [required, String] :text
472
+ # A UTF-8 text string. Each string must contain fewer that 5,000 bytes
473
+ # of UTF-8 encoded characters.
474
+ #
475
+ # @option params [required, String] :language_code
476
+ # The RFC 5646 language code for the input text. If you don't specify a
477
+ # language code, Amazon Comprehend detects the dominant language. If you
478
+ # specify the code for a language that Amazon Comprehend does not
479
+ # support, it returns and `UnsupportedLanguageException`. For more
480
+ # information about RFC 5646, see [Tags for Identifying Languages][1] on
481
+ # the *IETF Tools* web site.
482
+ #
483
+ #
484
+ #
485
+ # [1]: https://tools.ietf.org/html/rfc5646
486
+ #
487
+ # @return [Types::DetectKeyPhrasesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
488
+ #
489
+ # * {Types::DetectKeyPhrasesResponse#key_phrases #key_phrases} => Array&lt;Types::KeyPhrase&gt;
490
+ #
491
+ # @example Request syntax with placeholder values
492
+ #
493
+ # resp = client.detect_key_phrases({
494
+ # text: "String", # required
495
+ # language_code: "en", # required, accepts en, es
496
+ # })
497
+ #
498
+ # @example Response structure
499
+ #
500
+ # resp.key_phrases #=> Array
501
+ # resp.key_phrases[0].score #=> Float
502
+ # resp.key_phrases[0].text #=> String
503
+ # resp.key_phrases[0].begin_offset #=> Integer
504
+ # resp.key_phrases[0].end_offset #=> Integer
505
+ #
506
+ # @see http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/DetectKeyPhrases AWS API Documentation
507
+ #
508
+ # @overload detect_key_phrases(params = {})
509
+ # @param [Hash] params ({})
510
+ def detect_key_phrases(params = {}, options = {})
511
+ req = build_request(:detect_key_phrases, params)
512
+ req.send_request(options)
513
+ end
514
+
515
+ # Inspects text and returns an inference of the prevailing sentiment
516
+ # (`POSITIVE`, `NEUTRAL`, `MIXED`, or `NEGATIVE`).
517
+ #
518
+ # @option params [required, String] :text
519
+ # A UTF-8 text string. Each string must contain fewer that 5,000 bytes
520
+ # of UTF-8 encoded characters.
521
+ #
522
+ # @option params [required, String] :language_code
523
+ # The RFC 5646 language code for the input text. If you don't specify a
524
+ # language code, Amazon Comprehend detects the dominant language. If you
525
+ # specify the code for a language that Amazon Comprehend does not
526
+ # support, it returns and `UnsupportedLanguageException`. For more
527
+ # information about RFC 5646, see [Tags for Identifying Languages][1] on
528
+ # the *IETF Tools* web site.
529
+ #
530
+ #
531
+ #
532
+ # [1]: https://tools.ietf.org/html/rfc5646
533
+ #
534
+ # @return [Types::DetectSentimentResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
535
+ #
536
+ # * {Types::DetectSentimentResponse#sentiment #sentiment} => String
537
+ # * {Types::DetectSentimentResponse#sentiment_score #sentiment_score} => Types::SentimentScore
538
+ #
539
+ # @example Request syntax with placeholder values
540
+ #
541
+ # resp = client.detect_sentiment({
542
+ # text: "String", # required
543
+ # language_code: "en", # required, accepts en, es
544
+ # })
545
+ #
546
+ # @example Response structure
547
+ #
548
+ # resp.sentiment #=> String, one of "POSITIVE", "NEGATIVE", "NEUTRAL", "MIXED"
549
+ # resp.sentiment_score.positive #=> Float
550
+ # resp.sentiment_score.negative #=> Float
551
+ # resp.sentiment_score.neutral #=> Float
552
+ # resp.sentiment_score.mixed #=> Float
553
+ #
554
+ # @see http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/DetectSentiment AWS API Documentation
555
+ #
556
+ # @overload detect_sentiment(params = {})
557
+ # @param [Hash] params ({})
558
+ def detect_sentiment(params = {}, options = {})
559
+ req = build_request(:detect_sentiment, params)
560
+ req.send_request(options)
561
+ end
562
+
563
+ # Gets a list of the topic detection jobs that you have submitted.
564
+ #
565
+ # @option params [Types::TopicsDetectionJobFilter] :filter
566
+ # Filters the jobs that are returned. Jobs can be filtered on their
567
+ # name, status, or the date and time that they were submitted. You can
568
+ # set only one filter at a time.
569
+ #
570
+ # @option params [String] :next_token
571
+ # Identifies the next page of results to return.
572
+ #
573
+ # @option params [Integer] :max_results
574
+ # The maximum number of results to return in each page.
575
+ #
576
+ # @return [Types::ListTopicsDetectionJobsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
577
+ #
578
+ # * {Types::ListTopicsDetectionJobsResponse#topics_detection_job_properties_list #topics_detection_job_properties_list} => Array&lt;Types::TopicsDetectionJobProperties&gt;
579
+ # * {Types::ListTopicsDetectionJobsResponse#next_token #next_token} => String
580
+ #
581
+ # @example Request syntax with placeholder values
582
+ #
583
+ # resp = client.list_topics_detection_jobs({
584
+ # filter: {
585
+ # job_name: "JobName",
586
+ # job_status: "SUBMITTED", # accepts SUBMITTED, IN_PROGRESS, COMPLETED, FAILED
587
+ # submit_time_before: Time.now,
588
+ # submit_time_after: Time.now,
589
+ # },
590
+ # next_token: "String",
591
+ # max_results: 1,
592
+ # })
593
+ #
594
+ # @example Response structure
595
+ #
596
+ # resp.topics_detection_job_properties_list #=> Array
597
+ # resp.topics_detection_job_properties_list[0].job_id #=> String
598
+ # resp.topics_detection_job_properties_list[0].job_name #=> String
599
+ # resp.topics_detection_job_properties_list[0].job_status #=> String, one of "SUBMITTED", "IN_PROGRESS", "COMPLETED", "FAILED"
600
+ # resp.topics_detection_job_properties_list[0].message #=> String
601
+ # resp.topics_detection_job_properties_list[0].submit_time #=> Time
602
+ # resp.topics_detection_job_properties_list[0].end_time #=> Time
603
+ # resp.topics_detection_job_properties_list[0].input_data_config.s3_uri #=> String
604
+ # resp.topics_detection_job_properties_list[0].input_data_config.input_format #=> String, one of "ONE_DOC_PER_FILE", "ONE_DOC_PER_LINE"
605
+ # resp.topics_detection_job_properties_list[0].output_data_config.s3_uri #=> String
606
+ # resp.topics_detection_job_properties_list[0].number_of_topics #=> Integer
607
+ # resp.next_token #=> String
608
+ #
609
+ # @see http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/ListTopicsDetectionJobs AWS API Documentation
610
+ #
611
+ # @overload list_topics_detection_jobs(params = {})
612
+ # @param [Hash] params ({})
613
+ def list_topics_detection_jobs(params = {}, options = {})
614
+ req = build_request(:list_topics_detection_jobs, params)
615
+ req.send_request(options)
616
+ end
617
+
618
+ # Starts an asynchronous topic detection job. Use the
619
+ # `DescribeTopicDetectionJob` operation to track the status of a job.
620
+ #
621
+ # @option params [required, Types::InputDataConfig] :input_data_config
622
+ # Specifies the format and location of the input data for the job.
623
+ #
624
+ # @option params [required, Types::OutputDataConfig] :output_data_config
625
+ # Specifies where to send the output files.
626
+ #
627
+ # @option params [required, String] :data_access_role_arn
628
+ # The Amazon Resource Name (ARN) of the AWS Identity and Access
629
+ # Management (IAM) role that grants Amazon Comprehend read access to
630
+ # your input data.
631
+ #
632
+ # @option params [String] :job_name
633
+ # The identifier of the job.
634
+ #
635
+ # @option params [Integer] :number_of_topics
636
+ # The number of topics to detect.
637
+ #
638
+ # @option params [String] :client_request_token
639
+ # A unique identifier for the request. If you do not set the client
640
+ # request token, Amazon Comprehend generates one.
641
+ #
642
+ # **A suitable default value is auto-generated.** You should normally
643
+ # not need to pass this option.**
644
+ #
645
+ # @return [Types::StartTopicsDetectionJobResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
646
+ #
647
+ # * {Types::StartTopicsDetectionJobResponse#job_id #job_id} => String
648
+ # * {Types::StartTopicsDetectionJobResponse#job_status #job_status} => String
649
+ #
650
+ # @example Request syntax with placeholder values
651
+ #
652
+ # resp = client.start_topics_detection_job({
653
+ # input_data_config: { # required
654
+ # s3_uri: "S3Uri", # required
655
+ # input_format: "ONE_DOC_PER_FILE", # accepts ONE_DOC_PER_FILE, ONE_DOC_PER_LINE
656
+ # },
657
+ # output_data_config: { # required
658
+ # s3_uri: "S3Uri", # required
659
+ # },
660
+ # data_access_role_arn: "IamRoleArn", # required
661
+ # job_name: "JobName",
662
+ # number_of_topics: 1,
663
+ # client_request_token: "ClientRequestTokenString",
664
+ # })
665
+ #
666
+ # @example Response structure
667
+ #
668
+ # resp.job_id #=> String
669
+ # resp.job_status #=> String, one of "SUBMITTED", "IN_PROGRESS", "COMPLETED", "FAILED"
670
+ #
671
+ # @see http://docs.aws.amazon.com/goto/WebAPI/comprehend-2017-11-27/StartTopicsDetectionJob AWS API Documentation
672
+ #
673
+ # @overload start_topics_detection_job(params = {})
674
+ # @param [Hash] params ({})
675
+ def start_topics_detection_job(params = {}, options = {})
676
+ req = build_request(:start_topics_detection_job, params)
677
+ req.send_request(options)
678
+ end
679
+
680
+ # @!endgroup
681
+
682
+ # @param params ({})
683
+ # @api private
684
+ def build_request(operation_name, params = {})
685
+ handlers = @handlers.for(operation_name)
686
+ context = Seahorse::Client::RequestContext.new(
687
+ operation_name: operation_name,
688
+ operation: config.api.operation(operation_name),
689
+ client: self,
690
+ params: params,
691
+ config: config)
692
+ context[:gem_name] = 'aws-sdk-comprehend'
693
+ context[:gem_version] = '1.0.0'
694
+ Seahorse::Client::Request.new(handlers, context)
695
+ end
696
+
697
+ # @api private
698
+ # @deprecated
699
+ def waiter_names
700
+ []
701
+ end
702
+
703
+ class << self
704
+
705
+ # @api private
706
+ attr_reader :identifier
707
+
708
+ # @api private
709
+ def errors_module
710
+ Errors
711
+ end
712
+
713
+ end
714
+ end
715
+ end