gingergenius
gingergenius

Reputation: 95

Request to FormRecognizer stuck with notStarted status

I trained a custom model on some PDFs (5 custom tags) using the Form Recognizer web interface.

Now I am trying to get recognition results for the new PDFs using the azure-ai-formrecognizer package:

form_recognizer_client = FormRecognizerClient(endpoint, AzureKeyCredential(key))

poller = form_recognizer_client.begin_recognize_custom_forms_from_url(model_id=model_id, form_url=form_url, logging_enable=True)
result = poller.result()

This used to work just fine with the package version 3.1.0b2 and a model trained in v2.1.preview.2. Now I have a new custom model trained in v2.1.preview.3 and suddently the response from the poller is notStarted for minutes and does not complete.

Response status: 200
Response headers:
    'Content-Length': '109'
    'Content-Type': 'application/json; charset=utf-8'
    'x-envoy-upstream-service-time': '40'
    'apim-request-id': '30511eb2-ce10-4df0-b9ca-20e0a5f430ef'
    'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload'
    'x-content-type-options': 'nosniff'
    'Date': 'Mon, 03 May 2021 16:26:51 GMT'
Response content:
{"status":"notStarted","createdDateTime":"2021-05-03T16:26:46Z","lastUpdatedDateTime":"2021-05-03T16:26:51Z"}

For older models and different API versions, the request sometimes completes, sometimes does not. I cannot find any reproducible patterns.

Upvotes: 0

Views: 555

Answers (1)

Ali Raza
Ali Raza

Reputation: 61

It usually works by adding a time delay of 5 or 10 seconds after the POST operation is successful

Upvotes: 1

Related Questions