detect_dominant_language
(**kwargs)¶Determines the dominant language of the input text. For a list of languages that Amazon Comprehend can detect, see Amazon Comprehend Supported Languages.
See also: AWS API Documentation
Request Syntax
response = client.detect_dominant_language(
Text='string'
)
[REQUIRED]
A UTF-8 text string. The string must contain at least 20 characters. The maximum string size is 100 KB.
{
'Languages': [
{
'LanguageCode': 'string',
'Score': ...
},
]
}
Response Structure
The languages that Amazon Comprehend detected in the input text. For each language, the response returns the RFC 5646 language code and the level of confidence that Amazon Comprehend has in the accuracy of its inference. For more information about RFC 5646, see Tags for Identifying Languages on the IETF Tools web site.
Returns the code for the dominant language in the input text and the level of confidence that Amazon Comprehend has in the accuracy of the detection.
The RFC 5646 language code for the dominant language. For more information about RFC 5646, see Tags for Identifying Languages on the IETF Tools web site.
The level of confidence that Amazon Comprehend has in the accuracy of the detection.
Exceptions
Comprehend.Client.exceptions.InvalidRequestException
Comprehend.Client.exceptions.TextSizeLimitExceededException
Comprehend.Client.exceptions.InternalServerException