Amazon Textract boto3 response changed when using in lambda

0

Our application is looking for response from textract to be in a certain format all the time.

Wanted to know how to call textract from lambda(python) by giving a specific version ? Our script is always calling the latest version of textract.

Can you please point me to code snippet or an example on how we could call by giving version number ?

Thanks.

질문됨 2년 전412회 조회
2개 답변
0

Hi, thank you for using Textract. Textract did update the table model to support merged_cells and table_headers. https://aws.amazon.com/about-aws/whats-new/2022/03/amazon-textract-updates-tables-check-detection/

The update adds a new BlockType called "MERGED_CELLS" and Relationships Type "MERGED_CELL" and an EntityType "COLUMN_HEADER". If you don't need those, you can ignore them.

Outside of those additions the response is the same as the "older" one with all CELLs of a TABLE being the CHILD Relationship. See: https://docs.aws.amazon.com/textract/latest/dg/how-it-works-tables.html

I recommend using https://pypi.org/project/amazon-textract-response-parser/ for parsing the response in Python.

AWS
답변함 2년 전
0

There is no difference in response format when calling Textract from Lambda vs. locally or from an EC2 instance. BUT Lambda does not always include the latest SDK version.

Check https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html for more information. You may have to install the same boto3 version (here is an example: https://aws.amazon.com/premiumsupport/knowledge-center/lambda-python-runtime-errors/).

I usually use containers with Lambda now (generated with SAM or CDK) where I have full control.

AWS
답변함 2년 전

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

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

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

관련 콘텐츠