Open austinmw opened 3 months ago
print(document.get_text()) gets you the text and tables in plain text in the order appeared in the doc If you want the tables in csv within the, you would have to tag the tables using the linearization config and rplace them with their csv counterpart gotten from the document.tables This notebook helps: https://github.com/aws-samples/layout-aware-document-processing-and-retrieval-augmented-generation/blob/main/textract-api.ipynb
Supposed I have a document like this:
Where a table is located between two chunks of text, and I'd like to parse the document and save the parsed information, in order, to a text file.
If I use the
document_analysis
functionality, I can successfully extract the text and tables, and print them separately:However, this loses information about the layout (i.e., that in my example, the table is in between two pieces of text).
So how can I print the parsed text+tables in order? As in something like:
print(document.text_and_tables)
Is there any convenience functionality in this library to do this?