detectEntitiesV2 method
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 InvalidEncodingException.
May throw InvalidRequestException.
May throw ServiceUnavailableException.
May throw TextSizeLimitExceededException.
May throw TooManyRequestsException.
Parameter text :
A UTF-8 string containing the clinical content being examined for
entities.
Implementation
Future<DetectEntitiesV2Response> detectEntitiesV2({
required String text,
}) async {
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);
}