Skip to content

Commit a1505b7

Browse files
authored
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.
1 parent cb957c5 commit a1505b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

documentai/snippets/batch_process_documents_sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def batch_process_documents(
102102
field_value = get_text(form_field.field_value, document)
103103
print("Extracted key value pair:")
104104
print(f"\t{field_name}, {field_value}")
105-
for paragraph in document.pages:
105+
for paragraph in page.paragraphs:
106106
paragraph_text = get_text(paragraph.layout, document)
107107
print(f"Paragraph text:\n{paragraph_text}")
108108
else:

0 commit comments

Comments
 (0)