From c4aca1bc1c01b3e1fdcc644eaf8922552c6c99a7 Mon Sep 17 00:00:00 2001 From: dgallegos Date: Tue, 25 May 2021 14:35:36 -0500 Subject: [PATCH] fix: Parsing pages, but should be paragraphs (#147) The code intends to be parsing paragraphs from a page, but was instead parsing pages from a document. --- samples/snippets/batch_process_documents_sample.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/batch_process_documents_sample.py b/samples/snippets/batch_process_documents_sample.py index a66ff441..88217093 100644 --- a/samples/snippets/batch_process_documents_sample.py +++ b/samples/snippets/batch_process_documents_sample.py @@ -102,7 +102,7 @@ def batch_process_documents( field_value = get_text(form_field.field_value, document) print("Extracted key value pair:") print(f"\t{field_name}, {field_value}") - for paragraph in document.pages: + for paragraph in page.paragraphs: paragraph_text = get_text(paragraph.layout, document) print(f"Paragraph text:\n{paragraph_text}") else: