How to extract key-value pair using Analyze expense API in AWS Textract using python ?

0

How to extract key-value pair using Analyze expense API in AWS Textract using python ?

質問済み 1年前647ビュー
2回答
0

Hi User,

As you are using expense API, are you using it on receipts or invoice documents? Expense API can help by detecting possible labels and their corresponding values, similar to key-value pair. Here is an article with sample codes in Python on how it can be achieved: https://docs.aws.amazon.com/textract/latest/dg/analyzing-document-expense.html

The results will be in JSON format, which then you can re-format the data to suit your use case.

profile pictureAWS
エキスパート
ljunkai
回答済み 1年前
0

You can use the Amazon Textract PrettyPrinter for this purpose. The Amazon Textract Response Parser does have a test that does that:

# json_response holds the response from the ExpenseAPI call
exp_docs: texp.TAnalyzeExpenseDocument = texp.TAnalyzeExpenseDocumentSchema().load(json_response)
all_fields = exp_docs.get_all_summaryfields_by_expense_id(docid=exp_doc.expense_idx)
normalized_fields = exp_docs.get_normalized_summaryfields_by_expense_id(docid=exp_doc.expense_idx)
AWS
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン