it means that the analysis process has been accepted, but it hasn't started yet or is still in progress. In this case, you need to wait for the analysis to complete before retrieving the results.
To start the analysis process and retrieve the results using the local container v2.1, you can follow these steps:
Make sure the Form Recognizer container is running and accessible in your VM. You can check the container status using the docker ps
command.
Use the POST /formrecognizer/v2.1/custom/models/{modelId}/analyze
API endpoint to submit the document for analysis. Replace {modelId}
with the ID of your custom model.
Here's an example using cURL:
bashCopy code
curl -X POST -H "Content-Type: application/pdf" --data-binary @<path_to_document> "http://localhost:5000/formrecognizer/v2.1/custom/models/{modelId}/analyze"
Replace <path_to_document>
with the path to your document file.
Note: Make sure to set the Content-Type
header to the appropriate value based on your document type (e.g., application/pdf for PDF files).
After submitting the document for analysis, you will receive a 202 Accepted response with a Location
header in the response. The Location
header contains the URL to check the status of the analysis.
Use the GET
request on the URL provided in the Location
header to check the analysis status. You can use the curl
command again, this time with a GET
request:
bashCopy code
curl -X GET "http://localhost:5000/<analyzeUrl>"
Replace <analyzeUrl>
with the URL from the Location
header.
Check the response to see if the analysis has completed. If the status is still "notStarted" or "running," it means the analysis is still in progress. You need to wait and check the status again until it changes to "succeeded" or "failed."
Once the analysis is complete and the status is "succeeded," you can retrieve the results using the GET /formrecognizer/v2.1/custom/models/{modelId}/analyzeResults/{analyzeResultId}
API endpoint.
Here's an example using cURL:
bashCopy code
curl -X GET "http://localhost:5000/formrecognizer/v2.1/custom/models/{modelId}/analyzeResults/{analyzeResultId}"
Replace {modelId}
with the ID of your custom model, and {analyzeResultId}
with the ID of the analyze result.
By following these steps, you can start the document analysis process using a local container v2.1 and retrieve the results once the analysis is complete.