How do I enable the optional language extraction feature while calling the documentAnalysisClient and in the method AnalyzeDocumentAsync in SDK using C# with the 2023-07-31(GA) api version

2024-03-13T09:17:03.15+00:00

How do I enable the optional language extraction feature while calling the documentAnalysisClient and in the method AnalyzeDocumentAsync in SDK using C# with the 2023-07-31(GA) api version

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,793 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VasaviLankipalle-MSFT 18,296 Reputation points
    2024-03-18T21:52:34.38+00:00

    Hello @Devicharan, Nagubilli [Admin] (US) , if you are looking for the Language detection feature, then after adding the languages feature to the analyzeResult request predicts the detected primary language for each text line along with the confidence in the languages collection under analyzeResult.

    Here is the sample code you can refer to:

    AnalyzeDocumentOperation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-read", stream);
    AnalyzeResult result = operation.Value;
    
    Console.WriteLine("Detected languages:");
    
    foreach (DocumentLanguage language in result.Languages)
    {
        Console.WriteLine($"  Found language with locale '{language.Locale}' and confidence language.Confidence}.");
    }
    

    Here please refer to this documentation related to SDK : https://learn.microsoft.com/en-us/dotnet/api/azure.ai.formrecognizer.documentanalysis.documentanalysisfeature.languages?view=azure-dotnet#azure-ai-formrecognizer-documentanalysis-documentanalysisfeature-languages

    I hope this helps.

    Regards,

    Vasavi

    -Please kindly accept the answer and vote 'yes' if you feel helpful to support the community, thanks.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.