Search in sources :

Example 6 with ComprehendClient

use of software.amazon.awssdk.services.comprehend.ComprehendClient in project aws-doc-sdk-examples by awsdocs.

the class DocumentClassifierDemo method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage: " + "DocumentClassifierDemo <dataAccessRoleArn> <s3Uri> <documentClassifierName>\n\n" + "Where:\n" + "  dataAccessRoleArn - the ARN value of the role used for this operation.\n\n" + "  s3Uri - the Amazon S3 bucket that contains the CSV file.\n\n" + "  documentClassifierName - the name of the document classifier.\n\n";
    if (args.length != 3) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String dataAccessRoleArn = args[0];
    String s3Uri = args[1];
    String documentClassifierName = args[2];
    Region region = Region.US_EAST_1;
    ComprehendClient comClient = ComprehendClient.builder().region(region).build();
    createDocumentClassifier(comClient, dataAccessRoleArn, s3Uri, documentClassifierName);
    comClient.close();
}
Also used : ComprehendClient(software.amazon.awssdk.services.comprehend.ComprehendClient) Region(software.amazon.awssdk.regions.Region)

Example 7 with ComprehendClient

use of software.amazon.awssdk.services.comprehend.ComprehendClient in project aws-doc-sdk-examples by awsdocs.

the class DetectEntities method main.

public static void main(String[] args) {
    String text = "Amazon.com, Inc. is located in Seattle, WA and was founded July 5th, 1994 by Jeff Bezos, allowing customers to buy everything from books to blenders. Seattle is north of Portland and south of Vancouver, BC. Other notable Seattle - based companies are Starbucks and Boeing.";
    Region region = Region.US_EAST_1;
    ComprehendClient comClient = ComprehendClient.builder().region(region).build();
    System.out.println("Calling DetectEntities");
    detectAllEntities(comClient, text);
    comClient.close();
}
Also used : ComprehendClient(software.amazon.awssdk.services.comprehend.ComprehendClient) Region(software.amazon.awssdk.regions.Region)

Aggregations

Region (software.amazon.awssdk.regions.Region)7 ComprehendClient (software.amazon.awssdk.services.comprehend.ComprehendClient)7 ComprehendException (software.amazon.awssdk.services.comprehend.model.ComprehendException)1 DetectDominantLanguageRequest (software.amazon.awssdk.services.comprehend.model.DetectDominantLanguageRequest)1 DetectDominantLanguageResponse (software.amazon.awssdk.services.comprehend.model.DetectDominantLanguageResponse)1 DominantLanguage (software.amazon.awssdk.services.comprehend.model.DominantLanguage)1