Search in sources :

Example 1 with AWSComprehendMedical

use of com.amazonaws.services.comprehendmedical.AWSComprehendMedical in project aws-doc-sdk-examples by awsdocs.

the class SampleAPICall method main.

public static void main() {
    AWSCredentialsProvider credentials = new AWSStaticCredentialsProvider(new BasicAWSCredentials("YOUR AWS ACCESS KEY", "YOUR AWS SECRET"));
    AWSComprehendMedical client = AWSComprehendMedicalClient.builder().withCredentials(credentials).withRegion("YOUR REGION").build();
    DetectEntitiesRequest request = new DetectEntitiesRequest();
    request.setText("cerealx 84 mg daily");
    DetectEntitiesResult result = client.detectEntities(request);
    result.getEntities().forEach(System.out::println);
}
Also used : AWSComprehendMedical(com.amazonaws.services.comprehendmedical.AWSComprehendMedical) AWSStaticCredentialsProvider(com.amazonaws.auth.AWSStaticCredentialsProvider) DetectEntitiesResult(com.amazonaws.services.comprehendmedical.model.DetectEntitiesResult) DetectEntitiesRequest(com.amazonaws.services.comprehendmedical.model.DetectEntitiesRequest) AWSCredentialsProvider(com.amazonaws.auth.AWSCredentialsProvider) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials)

Aggregations

AWSCredentialsProvider (com.amazonaws.auth.AWSCredentialsProvider)1 AWSStaticCredentialsProvider (com.amazonaws.auth.AWSStaticCredentialsProvider)1 BasicAWSCredentials (com.amazonaws.auth.BasicAWSCredentials)1 AWSComprehendMedical (com.amazonaws.services.comprehendmedical.AWSComprehendMedical)1 DetectEntitiesRequest (com.amazonaws.services.comprehendmedical.model.DetectEntitiesRequest)1 DetectEntitiesResult (com.amazonaws.services.comprehendmedical.model.DetectEntitiesResult)1