Need help extracting summary fields with Amazon Textract API in a Laravel application

0

Hello everyone,

I'm currently developing a Laravel application that utilizes Amazon's Textract API to analyze expenses. I've successfully integrated the API and called the analyseExpense method; however, I'm facing challenges in extracting summary fields and establishing correct links between the blocks and summary information from the method's response.

Has anyone worked with the Textract API and could provide guidance on how to extract these specific data and correctly link them?

I'm particularly interested in how to process the response from the analyseExpense method to obtain summary information such as [RECEIVER_NAME, ADDRESS_BLOCK, VAT NUMBER, CLIENT, SIREN number, Invoice number,TOTAL, SUBTOTAL,TAX,PAYMENT TERM] and how to establish the correct links between this information and the corresponding blocks in the Textract response.

Here's an excerpt from my current code to provide more context:

$analyseExpenseResponse = $textractClient->analyseExpense($params);
// retreive the JSONObject to extract the DATA
$facture = $textrackInvoice->processInvoice($analyseExpenseResponse);
Here's an excerpt from my current code to provide more context:

Any help would be greatly appreciated. Thank you in advance!

asked 5 months ago170 views
1 Answer
0

Hi Dimitri,

Thank you for your question. Our Developer guide contains details on what the Analyze Expense output looks like

Additionally, we have the following post-processing libraries in Python and JavaScript that contains logic to parse the Amazon Textract Analyze Expense output JSON.

Hope this helps.

AWS
keithm
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions