Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions python/Textract-Table-Merged-Cells-And-Headers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"source": [
"We will be using the modules below:\n",
"* amazon-textract-caller (https://pypi.org/project/amazon-textract-caller/) to invoke Amazon Textract API on our behalf\n",
"* amazon-textract-response-parser (http://%28https//pypi.org/project/amazon-textract-response-parser/) to parse the response payload\n",
"* amazoon-textract-prettyprinter (https://pypi.org/project/amazon-textract-prettyprinter/) to \"pretty-print\" tables"
"* amazon-textract-response-parser (https://pypi.org/project/amazon-textract-response-parser/) to parse the response payload\n",
"* amazon-textract-prettyprinter (https://pypi.org/project/amazon-textract-prettyprinter/) to \"pretty-print\" tables\n",
"\n",
"The code can be ran using Python 3.7 or newer."
]
},
{
Expand All @@ -28,8 +30,7 @@
"source": [
"!pip install boto3\n",
"!pip install amazon-textract-caller\n",
"!pip install amazon-textract-prettyprinter\n",
"!pip install trp"
"!pip install amazon-textract-prettyprinter"
]
},
{
Expand Down Expand Up @@ -117,7 +118,7 @@
"for page in trp_doc.pages:\n",
" for table in page.tables:\n",
" table_data = []\n",
" headers = table.get_header_field_names()\n",
" headers = []\n",
" if(len(headers)>0): #Let's retain the only table with headers\n",
" print(\"Statememt headers: \"+ repr(headers))\n",
" top_header= headers[0]\n",
Expand Down