【问题标题】:Request to FormRecognizer stuck with notStarted status对 FormRecognizer 的请求停留在 notStarted 状态
【发布时间】:2021-05-03 16:32:51
【问题描述】:

我使用表单识别器 Web 界面在一些 PDF(5 个自定义标签)上训练了一个自定义模型。

现在我正在尝试使用 azure-ai-formrecognizer 包获得新 PDF 的识别结果:

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()

这曾经在包版本 3.1.0b2 和在 v2.1.preview.2 中训练的模型上工作得很好。现在我有一个在 v2.1.preview.3 中训练的新自定义模型,突然轮询器的响应是 notStarted 几分钟并且没有完成。

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"}

对于较旧的模型和不同的 API 版本,请求有时会完成,有时不会。我找不到任何可重现的模式。

【问题讨论】:

  • 嗨@gingergenius - 我试图在SDK中重现这个,但遇到了一些麻烦(就像你提到的那样)。您能否分享您在哪个区域创建表单识别器资源?
  • 它在西欧。截至目前,使用 SDK 版本 3.1.0b4 可以正常工作,但切换后似乎无法立即工作。
  • 表单识别器资源的日志中有一些“客户端错误”。我是 Azure 中的 Logs 新手,所以我似乎找不到查看确切错误消息的方法

标签: python form-recognizer azure-form-recognizer


【解决方案1】:

通常在POST操作成功后添加5或10秒的延时来工作

【讨论】:

    猜你喜欢
    • 2022-08-03
    • 1970-01-01
    • 2021-09-08
    • 1970-01-01
    • 2019-01-25
    • 1970-01-01
    • 2013-01-24
    • 2011-08-30
    • 1970-01-01
    相关资源
    最近更新 更多