Azure.RequestFailedException: Failed to process task after several retry Status: 200 (OK) ErrorCode: InternalServerError

Mason Nguyen 10 Reputation points
2023-01-30T09:12:22.68+00:00

Hi everyone, I have an issue with PII Recognition

document A: only hindi characters

nमेर  चैनल म   ूज और सद  नह  बढ़ रह  ह"

document B: (english characters, emoji, hindi characters)


1/12/23, 1:54 PM YouTube Community\nView all posts\nWatch and subscribe (Desktop, Mobile and other devices)\nViews problem\nमेर  चैनल म   ूज और सद  नह  बढ़ रह  ह \nYouTube Go is going away in August of this year Announcement\nView all\nUpload videos and manage my channel\nYouTube Handle unavailable\ncommunity tab for people with less than 500 subscriberz\nOrganization channel, managed by a tech person who has le , now how to manage the\nchannel\nView all\nConnect with Comments, Posts, Stories and more\n🎬 Ask the YouTube team (India) - Connecting with your audience Announcement\nRecent Repo s of Missing Comments\nUpdates to Captions and Audio Features on YouTube\nhttps://support.google.com/youtube/community?hl=en 2/4
1/12/23, 1:54 


var client = new TextAnalyticsClient(endPoint, key);
var result = new List<NamedEntityRecognitionResult>();
TextAnalyticsActions actions = new TextAnalyticsActions(){
   RecognizePiiEntitiesActions = new List<RecognizePiiEntitiesAction>()   { 
     new()      {         DisableServiceLogs = true,      }  
 }
};
var operation = await client.StartAnalyzeActionsAsync(documents, actions, "auto");


await foreach (var documentsInPage in operation.Value){
   var recognizePiiEntitiesResults = documentsInPage.RecognizePiiEntitiesResults; 
  var docResults = recognizePiiEntitiesResults.FirstOrDefault()?.DocumentsResults.Where(x => !x.HasError); 
}

with document B, I received the error at line

var operation = await client.StartAnalyzeActionsAsync(documents, actions, "auto");

User's image

If I remove

मेर  चैनल म   ूज और सद  नह  बढ़ रह  ह

🎬

it works and I can extract the entities from result

with document A, It can pass line

var operation = await client.StartAnalyzeActionsAsync(documents, actions, "auto");

but it throws the exception because of unsupported languageUser's image

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,984 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,223 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Mason Nguyen 10 Reputation points
    2023-01-31T08:05:00.81+00:00

    Hi @romungi-MSFT , I've just tested with RecognizePiiEntitiesBatch and RestApi from C# using HttpClient, It ran without errors. I believe that the issue coming from the SDK when serializing object to json

    This is my code

    example.txt

    Thanks for your support

    1 person found this answer helpful.
    0 comments No comments

  2. romungi-MSFT 41,361 Reputation points Microsoft Employee
    2023-01-31T05:11:48.89+00:00

    Mason Nguyen Since you are using the PII entities in the actions "Hindi" is not supported as language where the service can recognize PII. Please see the language support page here. So, for document A the response is expected because it detected the language as Hindi.

    For document B the response might have failed due to unknown reason which can only be looked up through service request by providing the request id to the service team. As such, if I used the same text copied from this page it runs successfully with REST API using CURL.

    In general, if you are planning to use text from a text box where multiple languages and other rich formatting is supported, please ensure to pre-process the text to remove unwanted characters or URLs or images.

    -Please kindly accept the answer if the answer was helpful to support the community, thanks.