Skip to content

Commit 06efb37

Browse files
committed
feat(aws-android-sdk-comprehend): update models to latest
1 parent 46fb3c3 commit 06efb37

File tree

727 files changed

+3944
-1383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

727 files changed

+3944
-1383
lines changed

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehend.java

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -237,7 +237,7 @@ BatchDetectSyntaxResult batchDetectSyntax(BatchDetectSyntaxRequest batchDetectSy
237237
* <p>
238238
* For more information about targeted sentiment, see <a href=
239239
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
240-
* >Targeted sentiment</a>.
240+
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
241241
* </p>
242242
*
243243
* @param batchDetectTargetedSentimentRequest
@@ -263,17 +263,37 @@ BatchDetectTargetedSentimentResult batchDetectTargetedSentiment(
263263

264264
/**
265265
* <p>
266-
* Creates a new document classification request to analyze a single
267-
* document in real-time, using a previously created and trained custom
268-
* model and an endpoint.
266+
* Creates a classification request to analyze a single document in
267+
* real-time. <code>ClassifyDocument</code> supports the following model
268+
* types:
269269
* </p>
270+
* <ul>
271+
* <li>
270272
* <p>
271-
* You can input plain text or you can upload a single-page input document
272-
* (text, PDF, Word, or image).
273+
* Custom classifier - a custom model that you have created and trained. For
274+
* input, you can provide plain text, a single-page document (PDF, Word, or
275+
* image), or Amazon Textract API output. For more information, see <a href=
276+
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-document-classification.html"
277+
* >Custom classification</a> in the <i>Amazon Comprehend Developer
278+
* Guide</i>.
273279
* </p>
280+
* </li>
281+
* <li>
282+
* <p>
283+
* Prompt safety classifier - Amazon Comprehend provides a pre-trained model
284+
* for classifying input prompts for generative AI applications. For input,
285+
* you provide English plain text input. For prompt safety classification,
286+
* the response includes only the <code>Classes</code> field. For more
287+
* information about prompt safety classifiers, see <a href=
288+
* "https://docs.aws.amazon.com/comprehend/latest/dg/trust-safety.html#prompt-classification"
289+
* >Prompt safety classification</a> in the <i>Amazon Comprehend Developer
290+
* Guide</i>.
291+
* </p>
292+
* </li>
293+
* </ul>
274294
* <p>
275295
* If the system detects errors while processing a page in the input
276-
* document, the API response includes an entry in <code>Errors</code> that
296+
* document, the API response includes an <code>Errors</code> field that
277297
* describes the errors.
278298
* </p>
279299
* <p>
@@ -1263,7 +1283,7 @@ DetectSyntaxResult detectSyntax(DetectSyntaxRequest detectSyntaxRequest)
12631283
* <p>
12641284
* For more information about targeted sentiment, see <a href=
12651285
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
1266-
* >Targeted sentiment</a>.
1286+
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
12671287
* </p>
12681288
*
12691289
* @param detectTargetedSentimentRequest
@@ -1286,6 +1306,34 @@ DetectTargetedSentimentResult detectTargetedSentiment(
12861306
DetectTargetedSentimentRequest detectTargetedSentimentRequest)
12871307
throws AmazonClientException, AmazonServiceException;
12881308

1309+
/**
1310+
* <p>
1311+
* Performs toxicity analysis on the list of text strings that you provide
1312+
* as input. The API response contains a results list that matches the size
1313+
* of the input list. For more information about toxicity detection, see <a
1314+
* href=
1315+
* "https://docs.aws.amazon.com/comprehend/latest/dg/toxicity-detection.html"
1316+
* >Toxicity detection</a> in the <i>Amazon Comprehend Developer Guide</i>.
1317+
* </p>
1318+
*
1319+
* @param detectToxicContentRequest
1320+
* @return detectToxicContentResult The response from the DetectToxicContent
1321+
* service method, as returned by Amazon Comprehend.
1322+
* @throws InvalidRequestException
1323+
* @throws TextSizeLimitExceededException
1324+
* @throws UnsupportedLanguageException
1325+
* @throws InternalServerException
1326+
* @throws AmazonClientException If any internal errors are encountered
1327+
* inside the client while attempting to make the request or
1328+
* handle the response. For example if a network connection is
1329+
* not available.
1330+
* @throws AmazonServiceException If an error response is returned by Amazon
1331+
* Comprehend indicating either a problem with the data in the
1332+
* request, or a server side issue.
1333+
*/
1334+
DetectToxicContentResult detectToxicContent(DetectToxicContentRequest detectToxicContentRequest)
1335+
throws AmazonClientException, AmazonServiceException;
1336+
12891337
/**
12901338
* <p>
12911339
* Creates a new custom model that replicates a source custom model that you
@@ -1815,7 +1863,8 @@ PutResourcePolicyResult putResourcePolicy(PutResourcePolicyRequest putResourcePo
18151863

18161864
/**
18171865
* <p>
1818-
* Starts an asynchronous document classification job. Use the
1866+
* Starts an asynchronous document classification job using a custom
1867+
* classification model. Use the
18191868
* <code>DescribeDocumentClassificationJob</code> operation to track the
18201869
* progress of the job.
18211870
* </p>

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendAsync.java

Lines changed: 126 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -351,7 +351,7 @@ Future<BatchDetectSyntaxResult> batchDetectSyntaxAsync(
351351
* <p>
352352
* For more information about targeted sentiment, see <a href=
353353
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
354-
* >Targeted sentiment</a>.
354+
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
355355
* </p>
356356
*
357357
* @param batchDetectTargetedSentimentRequest
@@ -383,7 +383,7 @@ Future<BatchDetectTargetedSentimentResult> batchDetectTargetedSentimentAsync(
383383
* <p>
384384
* For more information about targeted sentiment, see <a href=
385385
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
386-
* >Targeted sentiment</a>.
386+
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
387387
* </p>
388388
*
389389
* @param batchDetectTargetedSentimentRequest
@@ -414,17 +414,37 @@ Future<BatchDetectTargetedSentimentResult> batchDetectTargetedSentimentAsync(
414414

415415
/**
416416
* <p>
417-
* Creates a new document classification request to analyze a single
418-
* document in real-time, using a previously created and trained custom
419-
* model and an endpoint.
417+
* Creates a classification request to analyze a single document in
418+
* real-time. <code>ClassifyDocument</code> supports the following model
419+
* types:
420420
* </p>
421+
* <ul>
422+
* <li>
421423
* <p>
422-
* You can input plain text or you can upload a single-page input document
423-
* (text, PDF, Word, or image).
424+
* Custom classifier - a custom model that you have created and trained. For
425+
* input, you can provide plain text, a single-page document (PDF, Word, or
426+
* image), or Amazon Textract API output. For more information, see <a href=
427+
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-document-classification.html"
428+
* >Custom classification</a> in the <i>Amazon Comprehend Developer
429+
* Guide</i>.
424430
* </p>
431+
* </li>
432+
* <li>
433+
* <p>
434+
* Prompt safety classifier - Amazon Comprehend provides a pre-trained model
435+
* for classifying input prompts for generative AI applications. For input,
436+
* you provide English plain text input. For prompt safety classification,
437+
* the response includes only the <code>Classes</code> field. For more
438+
* information about prompt safety classifiers, see <a href=
439+
* "https://docs.aws.amazon.com/comprehend/latest/dg/trust-safety.html#prompt-classification"
440+
* >Prompt safety classification</a> in the <i>Amazon Comprehend Developer
441+
* Guide</i>.
442+
* </p>
443+
* </li>
444+
* </ul>
425445
* <p>
426446
* If the system detects errors while processing a page in the input
427-
* document, the API response includes an entry in <code>Errors</code> that
447+
* document, the API response includes an <code>Errors</code> field that
428448
* describes the errors.
429449
* </p>
430450
* <p>
@@ -458,17 +478,37 @@ Future<ClassifyDocumentResult> classifyDocumentAsync(
458478

459479
/**
460480
* <p>
461-
* Creates a new document classification request to analyze a single
462-
* document in real-time, using a previously created and trained custom
463-
* model and an endpoint.
481+
* Creates a classification request to analyze a single document in
482+
* real-time. <code>ClassifyDocument</code> supports the following model
483+
* types:
484+
* </p>
485+
* <ul>
486+
* <li>
487+
* <p>
488+
* Custom classifier - a custom model that you have created and trained. For
489+
* input, you can provide plain text, a single-page document (PDF, Word, or
490+
* image), or Amazon Textract API output. For more information, see <a href=
491+
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-document-classification.html"
492+
* >Custom classification</a> in the <i>Amazon Comprehend Developer
493+
* Guide</i>.
464494
* </p>
495+
* </li>
496+
* <li>
465497
* <p>
466-
* You can input plain text or you can upload a single-page input document
467-
* (text, PDF, Word, or image).
498+
* Prompt safety classifier - Amazon Comprehend provides a pre-trained model
499+
* for classifying input prompts for generative AI applications. For input,
500+
* you provide English plain text input. For prompt safety classification,
501+
* the response includes only the <code>Classes</code> field. For more
502+
* information about prompt safety classifiers, see <a href=
503+
* "https://docs.aws.amazon.com/comprehend/latest/dg/trust-safety.html#prompt-classification"
504+
* >Prompt safety classification</a> in the <i>Amazon Comprehend Developer
505+
* Guide</i>.
468506
* </p>
507+
* </li>
508+
* </ul>
469509
* <p>
470510
* If the system detects errors while processing a page in the input
471-
* document, the API response includes an entry in <code>Errors</code> that
511+
* document, the API response includes an <code>Errors</code> field that
472512
* describes the errors.
473513
* </p>
474514
* <p>
@@ -2600,7 +2640,7 @@ Future<DetectSyntaxResult> detectSyntaxAsync(DetectSyntaxRequest detectSyntaxReq
26002640
* <p>
26012641
* For more information about targeted sentiment, see <a href=
26022642
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
2603-
* >Targeted sentiment</a>.
2643+
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
26042644
* </p>
26052645
*
26062646
* @param detectTargetedSentimentRequest
@@ -2631,7 +2671,7 @@ Future<DetectTargetedSentimentResult> detectTargetedSentimentAsync(
26312671
* <p>
26322672
* For more information about targeted sentiment, see <a href=
26332673
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
2634-
* >Targeted sentiment</a>.
2674+
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
26352675
* </p>
26362676
*
26372677
* @param detectTargetedSentimentRequest
@@ -2659,6 +2699,71 @@ Future<DetectTargetedSentimentResult> detectTargetedSentimentAsync(
26592699
AsyncHandler<DetectTargetedSentimentRequest, DetectTargetedSentimentResult> asyncHandler)
26602700
throws AmazonServiceException, AmazonClientException;
26612701

2702+
/**
2703+
* <p>
2704+
* Performs toxicity analysis on the list of text strings that you provide
2705+
* as input. The API response contains a results list that matches the size
2706+
* of the input list. For more information about toxicity detection, see <a
2707+
* href=
2708+
* "https://docs.aws.amazon.com/comprehend/latest/dg/toxicity-detection.html"
2709+
* >Toxicity detection</a> in the <i>Amazon Comprehend Developer Guide</i>.
2710+
* </p>
2711+
*
2712+
* @param detectToxicContentRequest
2713+
* @return A Java Future object containing the response from the
2714+
* DetectToxicContent service method, as returned by Amazon
2715+
* Comprehend.
2716+
* @throws InvalidRequestException
2717+
* @throws TextSizeLimitExceededException
2718+
* @throws UnsupportedLanguageException
2719+
* @throws InternalServerException
2720+
* @throws AmazonClientException If any internal errors are encountered
2721+
* inside the client while attempting to make the request or
2722+
* handle the response. For example if a network connection is
2723+
* not available.
2724+
* @throws AmazonServiceException If an error response is returned by Amazon
2725+
* Comprehend indicating either a problem with the data in the
2726+
* request, or a server side issue.
2727+
*/
2728+
Future<DetectToxicContentResult> detectToxicContentAsync(
2729+
DetectToxicContentRequest detectToxicContentRequest) throws AmazonServiceException,
2730+
AmazonClientException;
2731+
2732+
/**
2733+
* <p>
2734+
* Performs toxicity analysis on the list of text strings that you provide
2735+
* as input. The API response contains a results list that matches the size
2736+
* of the input list. For more information about toxicity detection, see <a
2737+
* href=
2738+
* "https://docs.aws.amazon.com/comprehend/latest/dg/toxicity-detection.html"
2739+
* >Toxicity detection</a> in the <i>Amazon Comprehend Developer Guide</i>.
2740+
* </p>
2741+
*
2742+
* @param detectToxicContentRequest
2743+
* @param asyncHandler Asynchronous callback handler for events in the
2744+
* life-cycle of the request. Users could provide the
2745+
* implementation of the four callback methods in this interface
2746+
* to process the operation result or handle the exception.
2747+
* @return A Java Future object containing the response from the
2748+
* DetectToxicContent service method, as returned by Amazon
2749+
* Comprehend.
2750+
* @throws InvalidRequestException
2751+
* @throws TextSizeLimitExceededException
2752+
* @throws UnsupportedLanguageException
2753+
* @throws InternalServerException
2754+
* @throws AmazonClientException If any internal errors are encountered
2755+
* inside the client while attempting to make the request or
2756+
* handle the response. For example if a network connection is
2757+
* not available.
2758+
* @throws AmazonServiceException If an error response is returned by Amazon
2759+
* Comprehend indicating either a problem with the data in the
2760+
* request, or a server side issue.
2761+
*/
2762+
Future<DetectToxicContentResult> detectToxicContentAsync(
2763+
DetectToxicContentRequest detectToxicContentRequest,
2764+
AsyncHandler<DetectToxicContentRequest, DetectToxicContentResult> asyncHandler)
2765+
throws AmazonServiceException, AmazonClientException;
2766+
26622767
/**
26632768
* <p>
26642769
* Creates a new custom model that replicates a source custom model that you
@@ -3819,7 +3924,8 @@ Future<PutResourcePolicyResult> putResourcePolicyAsync(
38193924

38203925
/**
38213926
* <p>
3822-
* Starts an asynchronous document classification job. Use the
3927+
* Starts an asynchronous document classification job using a custom
3928+
* classification model. Use the
38233929
* <code>DescribeDocumentClassificationJob</code> operation to track the
38243930
* progress of the job.
38253931
* </p>
@@ -3850,7 +3956,8 @@ Future<StartDocumentClassificationJobResult> startDocumentClassificationJobAsync
38503956

38513957
/**
38523958
* <p>
3853-
* Starts an asynchronous document classification job. Use the
3959+
* Starts an asynchronous document classification job using a custom
3960+
* classification model. Use the
38543961
* <code>DescribeDocumentClassificationJob</code> operation to track the
38553962
* progress of the job.
38563963
* </p>

0 commit comments

Comments
 (0)