I am using azure-ai-textanalytics(version 5.2.7) library for detecting PII in some text content that I have.
From the azure documentation the maximum chars allowed while using asynchronous processing is 125,000 chars.
https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/concepts/data-limits
Using the azure library below is how I am constructing the asynchronous client:
private static TextAnalyticsAsyncClient createTextClient() {
if (textAnalyticsClient == null) {
textAnalyticsClient = new TextAnalyticsClientBuilder()
.credential(new AzureKeyCredential(AzureKeyVaultConnector.readKeyValue("languageResourceKey")))
.endpoint(AzureKeyVaultConnector.readKeyValue("languageResourceEndPoint"))
.buildAsyncClient();
}
return textAnalyticsClient;
}
And I submit the documents to process using the below line:
RecognizePiiEntitiesResultCollection piiEntityCollection = createTextClient().recognizePiiEntitiesBatch(documents,"en",requestOptions).block();
When I test with a string which is around 7000 chars, I get below error:
A document within the request was too large to be processed. Limit document size to: 5120 text elements. For additional details on the data limitations see https://aka.ms/text-analytics-data-limits
Why is it still trying to limit my max char size allowed to 5120? Shouldn't it be 125,000 since I am using async client? Any help is appreciated.
I would love to use azure-ai-textanalytics library and achieve this and not make direct http calls (Without using azure library).