# US 2026/0300612 A1 · Transformation of an unstructured document to a structured document

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0300612 A1
- Document ID: US20260300612A1
- Status: Published application
- Kind: A1
- Application number: 19/569,632
- Filed: 2026-03-17
- Published: 2026-10-01
- Earliest claimed: 2025-03-17
- Applicants: Vertesia, Inc.
- Inventors: Eric Barroca
- Web page: https://patentgrep.com/patent/US20260300612A1

## CPC

- G06F 40/137: Hierarchical processing, e.g. outlines
- G06F 16/258: {Data format conversion from or to a database}
- G06F 16/90335: {Query processing}
- G06F 16/93: Document management systems
- G06F 40/151: Transformation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for transforming an unstructured document into a structured document. In methods, a visual representation of a page of a flat document and raw text data of the page are extracted. A first model input including the visual representation of the page, the raw text, and a first prompt is created. The first model input to at least a first model, from which structural data of the page is obtained. Based on the structural data, a second model input is generated and submitted to a second model, and thereby causes the second model to generate a response specifying attributes of a specific type of content in the page. A hierarchically structured page is created based on the structural data, raw text, and attributes.

## Claims

### Claim 1

A computer-implemented method, comprising:
extracting, by a system including circuitry, a visual representation of a page of a flat document, raw text data from the flat document, wherein the raw text data includes position data of raw text included in the flat document;
creating, by the system, a first model input including the visual representation of the page, the raw text, and a first prompt, wherein the first prompt includes instructions that cause at least a first model to analyze the visual representation and raw text of the page and determine types of content elements included in the page;
submitting, by the system, the first model input to at least the first model;
obtaining, by the system, a first analysis response to the first model input specifying structural data of the page, wherein the structural data includes block identifiers corresponding to locations of content in the page and data specifying (i) whether the page includes a first type of content element and (ii) whether the page includes a second type of content element;
determining, based on the first analysis response, that the page includes the first type of content element;
in response to the determination that the page includes the first type of content element:
generating, by the system, a second model input including at least one of the visual representation or the raw text data, and a second prompt including instructions that cause performance, by at least a second model, of content-specific processing of the first type of content element;
submitting, by the system, the second model input to at least the second model;
obtaining, by the system, a second analysis response to the second model input specifying attributes of the first type of content element generated by at least the second model based on the second model input; and
creating, by the system, a hierarchically structured page based on the first analysis response, the second analysis response, the raw text extracted from the page, and the first type of content element included in the page, wherein creating the hierarchically structured page includes:
generating a first start tag that includes a block identifier corresponding to a portion of the raw text;
inserting the portion of raw text between the first start tag and a corresponding first end tag;
generating a second start tag that includes a block identifier corresponding to the first type of content element; and
inserting the attributes from the second analysis response between the second start tag and a corresponding second end tag.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
combining multiple hierarchically structured pages of the flat document into a hierarchically structured document;
receiving, by the system, a query related to the flat document; and
processing, by the system, the query using the hierarchically structured document.

### Claim 3 (depends on 1)

The method of claim 1, further comprising dynamically applying additional processing to content of the page based on the first analysis response.

### Claim 4 (depends on 3)

The method of claim 3, wherein:
the second type of content element is an image; and
dynamically applying additional processing to the content of the page based on the first analysis response comprises applying image processing to the image based on the structure data indicating that the page includes the image.

### Claim 5 (depends on 3)

The method of claim 3, wherein dynamically applying additional processing to the content of the page based on the first analysis response comprises:
determining, by the system, that the page includes two or more different types of content elements based on the first analysis response; and
applying, by the system, two or more different types of content-specific processing to content of the page based on the determination that the page includes the two or more different types of content elements.

### Claim 6 (depends on 5)

The method of claim 5, wherein applying the two or more different types of content-specific processing to the content of the page comprises applying two or more of table detection and extraction with column and row preservation, image identification and description, or optical recognition of text embedded in image.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
determining, after submitting the second model input to the second model and before obtaining the second analysis response, that an error condition exists; and
resubmitting the second model input to the second model or a different model in response to determining that the error condition exists.

### Claim 8

A system connected between a client device and one or more large language models (LLMs), comprising:
one or more memory devices; and
one or more data processing apparatus, including circuitry, configured to interact with the one or more memory devices and execute instructions that, upon execution, cause the one or more data processing apparatus to perform operations comprising:
extracting a visual representation of a page of a flat document, raw text data from the flat document, wherein the raw text data includes position data of raw text included in the flat document;
creating a first model input including the visual representation of the page, the raw text, and a first prompt, wherein the first prompt includes instructions that cause at least a first model to analyze the visual representation and raw text of the page and determine types of content elements included in the page;
submitting the first model input to at least the first model;
obtaining a first analysis response to the first model input specifying structural data of the page, wherein the structural data includes block identifiers corresponding to locations of content in the page and data specifying (i) whether the page includes a first type of content element and (ii) whether the page includes a second type of content element;
determining, based on the first analysis response, that the page includes the first type of content element;
in response to the determination that the page includes the first type of content element:
generating a second model input including at least one of the visual representation or the raw text data, and a second prompt including instructions that cause performance, by at least a second model, of content-specific processing of the first type of content element;
submitting the second model input to at least the second model;
obtaining a second analysis response to the second model input specifying attributes of the first type of content element generated by at least the second model based on the second model input; and
creating a hierarchically structured page based on the first response, the second analysis response, the raw text extracted from the page, and the first type of content element included in the page, wherein creating the hierarchically structured page includes:
generating a first start tag that includes a block identifier corresponding to a portion of the raw text;
inserting the portion of raw text between the first start tag and a corresponding first end tag;
generating a second start tag that includes a block identifier corresponding to the first type of content element; and
inserting the attributes from the second analysis response between the second start tag and a corresponding second end tag.

### Claim 9 (depends on 8)

The system of claim 8, wherein the instructions cause the one or more data processing apparatus to perform operations further comprising:
combining multiple hierarchically structured pages of the flat document into a hierarchically structured document;
receiving a query related to the flat document; and
processing the query using the hierarchically structured document.

### Claim 10 (depends on 8)

The system of claim 8, further comprising dynamically applying additional processing to content of the page based on the first analysis response.

### Claim 11 (depends on 10)

The system of claim 10, wherein:
the second type of content element is an image; and
dynamically applying additional processing to the content of the page based on the first analysis response comprises applying image processing to the image based on the structure data indicating that the page includes the image.

### Claim 12 (depends on 10)

The system of claim 10, wherein dynamically applying additional processing to the content of the page based on the first analysis response comprises:
determining, by the system, that the page includes two or more different types of content elements based on the first analysis response; and
applying, by the system, two or more different types of content-specific processing to content of the page based on the determination that the page includes the two or more different types of content elements.

### Claim 13 (depends on 12)

The system of claim 12, wherein applying the two or more different types of content-specific processing to the content of the page comprises applying two or more of table detection and extraction with column and row preservation, image identification and description, or optical recognition of text embedded in image.

### Claim 14 (depends on 8)

The system of claim 8, wherein the instructions cause the one or more data processing apparatus to perform operations further comprising:
determining, after submitting the second model input to the second model and before obtaining the second analysis response, that an error condition exists; and
resubmitting the second model input to the second model or a different model in response to determining that the error condition exists.

### Claim 15

One or more non-transitory computer readable medium storing instructions that, upon execution by one or more data processing apparatus of a system that is connected between a client device and one or more generative models, cause the one or more data processing apparatus to perform operations comprising:
extracting a visual representation of a page of a flat document, raw text data from the flat document, wherein the raw text data includes position data of raw text included in the flat document;
creating a first model input including the visual representation of the page, the raw text, and a first prompt, wherein the first prompt includes instructions that cause at least a first model to analyze the visual representation and raw text of the page and determine types of content elements included in the page;
submitting the first model input to at least the first model;
obtaining a first analysis response to the first model input specifying structural data of the page, wherein the structural data includes block identifiers corresponding to locations of content in the page and data specifying (i) whether the page includes a first type of content element and (ii) whether the page includes a second type of content element;
determining, based on the first analysis response, that the page includes the first type of content element;
in response to the determination that the page includes the first type of content element:
generating a second model input including at least one of the visual representation or the raw text data, and a second prompt including instructions that cause performance, by at least a second model, of content-specific processing of the first type of content element;
submitting the second model input to at least the second model;
obtaining a second analysis response to the second model input specifying attributes of the first type of content element generated by at least the second model based on the second model input; and
creating a hierarchically structured page based on the first response, the second analysis response, the raw text extracted from the page, and the first type of content element included in the page, wherein creating the hierarchically structured page includes:
generating a first start tag that includes a block identifier corresponding to a portion of the raw text;
inserting the portion of raw text between the first start tag and a corresponding first end tag;
generating a second start tag that includes a block identifier corresponding to the first type of content element; and
inserting the attributes from the second analysis response between the second start tag and a corresponding second end tag.

### Claim 16 (depends on 15)

The one or more non-transitory computer readable medium of claim 15, wherein the instructions cause the one or more data processing apparatus to perform operations further comprising:
combining multiple hierarchically structured pages of the flat document into a hierarchically structured document;
receiving a query related to the flat document; and
processing the query using the hierarchically structured document.

### Claim 17 (depends on 15)

The one or more non-transitory computer readable medium of claim 15, further comprising dynamically applying additional processing to content of the page based on the first analysis response.

### Claim 18 (depends on 17)

The one or more non-transitory computer readable medium of claim 17, wherein:
the second type of content element is an image; and
dynamically applying additional processing to the content of the page based on the first analysis response comprises applying image processing to the image based on the structure data indicating that the page includes the image.

### Claim 19 (depends on 17)

The one or more non-transitory computer readable medium of claim 17, wherein dynamically applying additional processing to the content of the page based on the first analysis response comprises:
determining, by the system, that the page includes two or more different types of content elements based on the first analysis response; and
applying, by the system, two or more different types of content-specific processing to content of the page based on the determination that the page includes the two or more different types of content elements.

### Claim 20 (depends on 19)

The one or more non-transitory computer readable medium of claim 19, wherein applying the two or more different types of content-specific processing to the content of the page comprises applying two or more of table detection and extraction with column and row preservation, image identification and description, or optical recognition of text embedded in image.

### Claim 21 (depends on 15)

The one or more non-transitory computer readable medium of claim 15, wherein the instructions cause the one or more data processing apparatus to perform operations further comprising:
determining, after submitting the second model input to the second model and before obtaining the second analysis response, that an error condition exists; and
resubmitting the second model input to the second model or a different model in response to determining that the error condition exists.
