detectEntitiesV2 method

Future<DetectEntitiesV2Response> detectEntitiesV2({
  1. required String text,
})

Inspects the clinical text for a variety of medical entities and returns specific information about them such as entity category, location, and confidence score on that information. Amazon Comprehend Medical only detects medical entities in English language texts.

The DetectEntitiesV2 operation replaces the DetectEntities operation. This new action uses a different model for determining the entities in your medical text and changes the way that some entities are returned in the output. You should use the DetectEntitiesV2 operation in all new applications.

The DetectEntitiesV2 operation returns the Acuity and Direction entities as attributes instead of types.

May throw InternalServerException. May throw ServiceUnavailableException. May throw TooManyRequestsException. May throw InvalidRequestException. May throw InvalidEncodingException. May throw TextSizeLimitExceededException.

Parameter text : A UTF-8 string containing the clinical content being examined for entities. Each string must contain fewer than 20,000 bytes of characters.

Implementation

Future<DetectEntitiesV2Response> detectEntitiesV2({
  required String text,
}) async {
  ArgumentError.checkNotNull(text, 'text');
  _s.validateStringLength(
    'text',
    text,
    1,
    20000,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'ComprehendMedical_20181030.DetectEntitiesV2'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Text': text,
    },
  );

  return DetectEntitiesV2Response.fromJson(jsonResponse.body);
}