Before performing entity recognition or PII detection, the connector determines the language of the content.
To identify the language, the connector analyzes the beginning of the submitted text and uses Amazon Comprehend language detection services. The detected language is then used when selecting the appropriate analysis operation.
Amazon Comprehend supports more languages for language detection than for entity recognition. If the detected language is not supported by the selected analysis operation, the connector uses a configured fallback language. By default, the fallback language is English.
To detect the language, the connector calls the DetectDominantLanguage API. The DetectDominantLanguage call only works on text smaller than a configurable limit, which by default is 5000 bytes. The connector uses the first 5000 bytes/characters of the document to determine what language to use when making calls to AWS Comprehend.