When parses a document, it breaks the content into chunks, which are discrete elements extracted from a document, like blocks of text or tables.
Each chunk includes a grounding, which represents the location of the chunk in the document. The grounding includes:
For example, below is the JSON output for a text
chunk. The grounding
object indicates that the text is on the first page, and the box
object indicates the bounding box coordinates.
When using any of the parsing functions from the library, you can use the optional grounding_save_dir
parameter to save each grounding as an image. The images are saved to a directory you specify.
Here’s an example of how to use the grounding_save_dir
parameter with the parse
parsing function:
Images are saved with this structure:
Where:
TIMESTAMP
is the time and date the document was parsedpage_0
is the page numberTYPE
is the chunk typeCHUNK_ID
is the chunk IDY
is the index of the grounding (in case a chunk spans multiple regions)