Skip to content

Commit

Permalink
fix: Parsing pages, but should be paragraphs (#147)
Browse files Browse the repository at this point in the history
The code intends to be parsing paragraphs from a page, but was instead parsing pages from a document.
  • Loading branch information
dgallegos authored and dandhlee committed Jan 5, 2023
1 parent 506aef0 commit c3ee3dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion documentai/snippets/batch_process_documents_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c3ee3dd

Please sign in to comment.