How to Utilize Textract Queries Confidence to be checked by a Human Review Workflow?

0

Looking into Human Review Workflows, I understand that key-value pairs can be passed for review, however is it possible to pass queries + query_results as a KV pair to be reviewed? Or is possible for a human review workflow to be triggered from the confidence value of QUERY_RESULT? For our solution we are reliant on TABLES and QUERIES but have no use for FORMS. We are scanning a specific document type that is a universal standard, however, in testing we found queries worked better than forms. Is it possible to convert queries and their answers to KV pairs?

  • Thanks Alex for the great references. I will get to work trying them out!

  • Hi Nunz - I have a similar requirement, where you able to set up your Human Review Workflows using QUERY_RESULT?

Nunz
질문됨 2년 전539회 조회
1개 답변
1

There are 2 ways you can integrate Amazon Textract with Amazon A2I for human review:

  1. The standard instructions in the Amazon Textract developer guide use the pre-built task template for Textract K-V review, with direct integration (specifying the human loop directly in the AnalyzeDocument call).
  2. A2I also supports custom task templates, allowing you to customize the review UI and controls - which can be started by explicit API request.

Today as you saw, the pre-built/direct UI integration is focussed on K-V pairs and I believe doesn't support reviewing Queries results.

What I would recommend is to use a custom integration (2) instead of the direct/built-in one (1), which will allow you to customize the UI and/or the data structure that the UI receives. The general flow would be:

  • Call Amazon Textract without HumanLoopConfig.
  • When the result is ready (either synchronous API response, or async SNS callback gets triggered), use a Lambda function or similar to transform the Textract JSON first and then start a human review.
  • Listen to the S3 output location for your human loop, to detect the upload of a result object and resume the process flow.

If you'd like to re-use the existing UI template, you could use the pre-A2I Lambda to transform the Amazon Textract payload before forwarding to the A2I service: Perhaps editing the JSON blocks to transform the query response blocks into KEY_VALUE_SET blocks, so that the existing template can render them. Alternatively, you could create a new task template using Liquid HTML (supporting embedded JavaScript).

I don't have an example for queries in particular, but would recommend referring to:

AWS
전문가
Alex_T
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠