Can I load data directly from a S3 Bucket for detecting key phrases in the AWS SDK for Java?

57 views Asked by At

I want to perform Key Phrase detection using AWS Comprehend.

Is there any way to load data directly from an S3 URI instead of manually loading data from S3 and passing it to the SDK?

1

There are 1 answers

0
Ermiya Eskandary On

Yes.

For Amazon Comprehend, there are usually 3 ways to do the same action:

  1. Synchronous action for one document e.g. DetectKeyPhrases
  2. Synchronous action for multiple documents e.g. BatchDetectKeyPhrases
  3. Asynchronous action for multiple documents e.g. StartKeyPhrasesDetectionJob

Most, if not all, of the time the synchronous actions take in Text or TextList directly & the asynchronous operations allow you to specific an S3 URI.

For detecting key phrases, this would be the StartKeyPhrasesDetectionJob, which takes in S3Uri for input data as well as output data.

All of these operations are available in the AWS SDK for Java v2 so feel free to refer to the SDK documentation for getting started.