Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comprehend Update models to latest #3521

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -237,7 +237,7 @@ BatchDetectSyntaxResult batchDetectSyntax(BatchDetectSyntaxRequest batchDetectSy
* <p>
* For more information about targeted sentiment, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
* >Targeted sentiment</a>.
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
* </p>
*
* @param batchDetectTargetedSentimentRequest
Expand All @@ -263,17 +263,37 @@ BatchDetectTargetedSentimentResult batchDetectTargetedSentiment(

/**
* <p>
* Creates a new document classification request to analyze a single
* document in real-time, using a previously created and trained custom
* model and an endpoint.
* Creates a classification request to analyze a single document in
* real-time. <code>ClassifyDocument</code> supports the following model
* types:
* </p>
* <ul>
* <li>
* <p>
* You can input plain text or you can upload a single-page input document
* (text, PDF, Word, or image).
* Custom classifier - a custom model that you have created and trained. For
* input, you can provide plain text, a single-page document (PDF, Word, or
* image), or Amazon Textract API output. For more information, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-document-classification.html"
* >Custom classification</a> in the <i>Amazon Comprehend Developer
* Guide</i>.
* </p>
* </li>
* <li>
* <p>
* Prompt safety classifier - Amazon Comprehend provides a pre-trained model
* for classifying input prompts for generative AI applications. For input,
* you provide English plain text input. For prompt safety classification,
* the response includes only the <code>Classes</code> field. For more
* information about prompt safety classifiers, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/trust-safety.html#prompt-classification"
* >Prompt safety classification</a> in the <i>Amazon Comprehend Developer
* Guide</i>.
* </p>
* </li>
* </ul>
* <p>
* If the system detects errors while processing a page in the input
* document, the API response includes an entry in <code>Errors</code> that
* document, the API response includes an <code>Errors</code> field that
* describes the errors.
* </p>
* <p>
Expand Down Expand Up @@ -1263,7 +1283,7 @@ DetectSyntaxResult detectSyntax(DetectSyntaxRequest detectSyntaxRequest)
* <p>
* For more information about targeted sentiment, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
* >Targeted sentiment</a>.
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
* </p>
*
* @param detectTargetedSentimentRequest
Expand All @@ -1286,6 +1306,34 @@ DetectTargetedSentimentResult detectTargetedSentiment(
DetectTargetedSentimentRequest detectTargetedSentimentRequest)
throws AmazonClientException, AmazonServiceException;

/**
* <p>
* Performs toxicity analysis on the list of text strings that you provide
* as input. The API response contains a results list that matches the size
* of the input list. For more information about toxicity detection, see <a
* href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/toxicity-detection.html"
* >Toxicity detection</a> in the <i>Amazon Comprehend Developer Guide</i>.
* </p>
*
* @param detectToxicContentRequest
* @return detectToxicContentResult The response from the DetectToxicContent
* service method, as returned by Amazon Comprehend.
* @throws InvalidRequestException
* @throws TextSizeLimitExceededException
* @throws UnsupportedLanguageException
* @throws InternalServerException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by Amazon
* Comprehend indicating either a problem with the data in the
* request, or a server side issue.
*/
DetectToxicContentResult detectToxicContent(DetectToxicContentRequest detectToxicContentRequest)
throws AmazonClientException, AmazonServiceException;

/**
* <p>
* Creates a new custom model that replicates a source custom model that you
Expand Down Expand Up @@ -1815,7 +1863,8 @@ PutResourcePolicyResult putResourcePolicy(PutResourcePolicyRequest putResourcePo

/**
* <p>
* Starts an asynchronous document classification job. Use the
* Starts an asynchronous document classification job using a custom
* classification model. Use the
* <code>DescribeDocumentClassificationJob</code> operation to track the
* progress of the job.
* </p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -351,7 +351,7 @@ Future<BatchDetectSyntaxResult> batchDetectSyntaxAsync(
* <p>
* For more information about targeted sentiment, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
* >Targeted sentiment</a>.
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
* </p>
*
* @param batchDetectTargetedSentimentRequest
Expand Down Expand Up @@ -383,7 +383,7 @@ Future<BatchDetectTargetedSentimentResult> batchDetectTargetedSentimentAsync(
* <p>
* For more information about targeted sentiment, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
* >Targeted sentiment</a>.
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
* </p>
*
* @param batchDetectTargetedSentimentRequest
Expand Down Expand Up @@ -414,17 +414,37 @@ Future<BatchDetectTargetedSentimentResult> batchDetectTargetedSentimentAsync(

/**
* <p>
* Creates a new document classification request to analyze a single
* document in real-time, using a previously created and trained custom
* model and an endpoint.
* Creates a classification request to analyze a single document in
* real-time. <code>ClassifyDocument</code> supports the following model
* types:
* </p>
* <ul>
* <li>
* <p>
* You can input plain text or you can upload a single-page input document
* (text, PDF, Word, or image).
* Custom classifier - a custom model that you have created and trained. For
* input, you can provide plain text, a single-page document (PDF, Word, or
* image), or Amazon Textract API output. For more information, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-document-classification.html"
* >Custom classification</a> in the <i>Amazon Comprehend Developer
* Guide</i>.
* </p>
* </li>
* <li>
* <p>
* Prompt safety classifier - Amazon Comprehend provides a pre-trained model
* for classifying input prompts for generative AI applications. For input,
* you provide English plain text input. For prompt safety classification,
* the response includes only the <code>Classes</code> field. For more
* information about prompt safety classifiers, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/trust-safety.html#prompt-classification"
* >Prompt safety classification</a> in the <i>Amazon Comprehend Developer
* Guide</i>.
* </p>
* </li>
* </ul>
* <p>
* If the system detects errors while processing a page in the input
* document, the API response includes an entry in <code>Errors</code> that
* document, the API response includes an <code>Errors</code> field that
* describes the errors.
* </p>
* <p>
Expand Down Expand Up @@ -458,17 +478,37 @@ Future<ClassifyDocumentResult> classifyDocumentAsync(

/**
* <p>
* Creates a new document classification request to analyze a single
* document in real-time, using a previously created and trained custom
* model and an endpoint.
* Creates a classification request to analyze a single document in
* real-time. <code>ClassifyDocument</code> supports the following model
* types:
* </p>
* <ul>
* <li>
* <p>
* Custom classifier - a custom model that you have created and trained. For
* input, you can provide plain text, a single-page document (PDF, Word, or
* image), or Amazon Textract API output. For more information, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-document-classification.html"
* >Custom classification</a> in the <i>Amazon Comprehend Developer
* Guide</i>.
* </p>
* </li>
* <li>
* <p>
* You can input plain text or you can upload a single-page input document
* (text, PDF, Word, or image).
* Prompt safety classifier - Amazon Comprehend provides a pre-trained model
* for classifying input prompts for generative AI applications. For input,
* you provide English plain text input. For prompt safety classification,
* the response includes only the <code>Classes</code> field. For more
* information about prompt safety classifiers, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/trust-safety.html#prompt-classification"
* >Prompt safety classification</a> in the <i>Amazon Comprehend Developer
* Guide</i>.
* </p>
* </li>
* </ul>
* <p>
* If the system detects errors while processing a page in the input
* document, the API response includes an entry in <code>Errors</code> that
* document, the API response includes an <code>Errors</code> field that
* describes the errors.
* </p>
* <p>
Expand Down Expand Up @@ -2600,7 +2640,7 @@ Future<DetectSyntaxResult> detectSyntaxAsync(DetectSyntaxRequest detectSyntaxReq
* <p>
* For more information about targeted sentiment, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
* >Targeted sentiment</a>.
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
* </p>
*
* @param detectTargetedSentimentRequest
Expand Down Expand Up @@ -2631,7 +2671,7 @@ Future<DetectTargetedSentimentResult> detectTargetedSentimentAsync(
* <p>
* For more information about targeted sentiment, see <a href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html"
* >Targeted sentiment</a>.
* >Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.
* </p>
*
* @param detectTargetedSentimentRequest
Expand Down Expand Up @@ -2659,6 +2699,71 @@ Future<DetectTargetedSentimentResult> detectTargetedSentimentAsync(
AsyncHandler<DetectTargetedSentimentRequest, DetectTargetedSentimentResult> asyncHandler)
throws AmazonServiceException, AmazonClientException;

/**
* <p>
* Performs toxicity analysis on the list of text strings that you provide
* as input. The API response contains a results list that matches the size
* of the input list. For more information about toxicity detection, see <a
* href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/toxicity-detection.html"
* >Toxicity detection</a> in the <i>Amazon Comprehend Developer Guide</i>.
* </p>
*
* @param detectToxicContentRequest
* @return A Java Future object containing the response from the
* DetectToxicContent service method, as returned by Amazon
* Comprehend.
* @throws InvalidRequestException
* @throws TextSizeLimitExceededException
* @throws UnsupportedLanguageException
* @throws InternalServerException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by Amazon
* Comprehend indicating either a problem with the data in the
* request, or a server side issue.
*/
Future<DetectToxicContentResult> detectToxicContentAsync(
DetectToxicContentRequest detectToxicContentRequest) throws AmazonServiceException,
AmazonClientException;

/**
* <p>
* Performs toxicity analysis on the list of text strings that you provide
* as input. The API response contains a results list that matches the size
* of the input list. For more information about toxicity detection, see <a
* href=
* "https://docs.aws.amazon.com/comprehend/latest/dg/toxicity-detection.html"
* >Toxicity detection</a> in the <i>Amazon Comprehend Developer Guide</i>.
* </p>
*
* @param detectToxicContentRequest
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the
* implementation of the four callback methods in this interface
* to process the operation result or handle the exception.
* @return A Java Future object containing the response from the
* DetectToxicContent service method, as returned by Amazon
* Comprehend.
* @throws InvalidRequestException
* @throws TextSizeLimitExceededException
* @throws UnsupportedLanguageException
* @throws InternalServerException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by Amazon
* Comprehend indicating either a problem with the data in the
* request, or a server side issue.
*/
Future<DetectToxicContentResult> detectToxicContentAsync(
DetectToxicContentRequest detectToxicContentRequest,
AsyncHandler<DetectToxicContentRequest, DetectToxicContentResult> asyncHandler)
throws AmazonServiceException, AmazonClientException;

/**
* <p>
* Creates a new custom model that replicates a source custom model that you
Expand Down Expand Up @@ -3819,7 +3924,8 @@ Future<PutResourcePolicyResult> putResourcePolicyAsync(

/**
* <p>
* Starts an asynchronous document classification job. Use the
* Starts an asynchronous document classification job using a custom
* classification model. Use the
* <code>DescribeDocumentClassificationJob</code> operation to track the
* progress of the job.
* </p>
Expand Down Expand Up @@ -3850,7 +3956,8 @@ Future<StartDocumentClassificationJobResult> startDocumentClassificationJobAsync

/**
* <p>
* Starts an asynchronous document classification job. Use the
* Starts an asynchronous document classification job using a custom
* classification model. Use the
* <code>DescribeDocumentClassificationJob</code> operation to track the
* progress of the job.
* </p>
Expand Down
Loading