Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.57k stars 4.82k forks source link

[QUERY] FormRecognizer - How Can I get an Output Like in the Studio? (paragraphs/tables in order per page) #38855

Open adammpolak opened 1 year ago

adammpolak commented 1 year ago

Library name and version

Azure.AI.FormRecognizer 4.1.0.0

Query/Question

Currently results returns "pages" which has "lines" There is also an output called "paragraphs" There is also an output "tables"

The data in "tables" also shows up in "paragraphs".

I want a data structure that is:

As they show up on the page. Which is how the studio represents the data: image

What can I do to make the data output appear like it does in studio? Where the paragraphs and tables are in the right order with no overlapping data?

This is my current request code:

 // NOTE: Ensure the client variable for the Form Recognizer is instantiated elsewhere in the program
    AnalyzeDocumentOperation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", stream);
    AnalyzeResult result = operation.Value;

Environment

.NET 6.0 running on linux containers, and Visual Studio locally on Windows.

github-actions[bot] commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ctstone @vkurpad.

adammpolak commented 1 year ago

@ctstone any luck?

ctstone commented 1 year ago

@adammpolak , I think you would have to compute merged ordering using the provided bounding box of each page element (paragraph, table, etc.). Sorry, we do not support this output structure from the service itself.

adammpolak commented 1 year ago

@adammpolak , I think you would have to compute merged ordering using the provided bounding box of each page element (paragraph, table, etc.). Sorry, we do not support this output structure from the service itself.

I ended up writing the code to do merge ordering but would be great if msft at one point releases whatever computation is being done to support the UI of Form Recognizer Studio.