question

FiremanderAI-3299 avatar image
0 Votes"
FiremanderAI-3299 asked FiremanderAI-3299 answered

Convert Form Recognizer Custom Model Json results to csv

There is a great quick start document on how to parse the json results using prebuilt models here that print the results to screen. I modified the sample to write the results to CSVs and it works. I am looking to do the same using Custom Models (with or without labels). Unfortunately, I cannot find any code samples that extract custom model data aside from the scripts that generate value confidence levels. These are good as they give the row and column indexes of each value.

But modifying the script by removing the confidence level information and writing json to csv using pandas (from this example) and other means is proving to be difficult and I haven't found many other examples. I am possibly looking in the wrong places? Have others created similar scripts or do I have to build my own? Any help is appreciated! Thank you in advance!


azure-form-recognizer
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

FiremanderAI-3299 avatar image
0 Votes"
FiremanderAI-3299 answered

Thank you for the quick response. Your findings are similar to mine. Upgrading my client library to 3.0. Initial documentation seems promising. Thank you again.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

romungi-MSFT avatar image
0 Votes"
romungi-MSFT answered

@FiremanderAI-3299 There is an option to directly download the CSV file from an analyze operation with the form recognizer labeling tool.
If you have not used the tool before the setup is pretty simple, you can follow this quickstart to setup a project with a blob container and create a custom model to analyze.

141930-image.png

I believe the script to extract the csv file from the analyze operation with REST API is created for API version 2.1 but this could possibly change with newer versions with the 3.0 preview. I think the newer version offers a single analyze API with an option to use custom and prebuilt model ids as parameters and the response should be easier to parse irrespective of the parameters passed. With the current v2.1 though, I have not come across an option to use a custom script to create a CSV file for custom model analyze operation other than the option to down the result from the labeling tool.

If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.



image.png (187.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.