Extract a Subdocument
This procedure extracts a subdocument from a document or file.
📘 Prerequisites
Ensure you have learned the Document Processing Book before using this operation. After learning the Book, make sure to publish your Agent and create a new Playground for it to take effect.
Overview
This operation extracts a subdocument from a document or file. A subdocument is a subsection of a larger document.
Syntax
The syntax for this operation begins with extract subdocument from the document
. Nested within this statement, you must specify the subdocument to be extracted.
⚠️ If the subdocument to be extracted is not specified, a question will be raised.
Ways to Specify a Subdocument for Extraction
1. Page Numbers
Specify the start and/or end page numbers of the subdocument:
2. Start and End Markers
Use textual markers to define where the subdocument begins and/or ends:
Included End Marker
Excluded End Marker
ℹ️ Included vs. Excluded End Markers
An included end marker (or just end marker) includes the specified page in the subdocument.
An excluded end marker does not include the specified page in the subdocument.
Optional: Specifying the OpenAI Model
Data
Components
This table lists the names of the data components in this operation and their properties.
the document
Yes
Required
the start page
No
Optional
the end page
No
Optional
the start page marker
No
Optional
the end page marker
No
Optional
the excluded end page marker
No
Optional
the openai model
No
Optional
Values
The table below lists the parameters in the operation. Parameters are placeholders for data values. In the operation's syntax, replace the parameters with your own data values as needed.
start
The starting page number. Defaults to the first page.
2
Optional
end
The ending page number. Defaults to the last page.
5
Optional
start marker
Text indicating where the subdocument should begin.
Section 2
Optional
end marker
Text indicating where the subdocument should end, including the specified marker.
Page is the beginning of an invoice
Optional
excluded end marker
Text indicating where the subdocument should end, excluding the specified marker.
Page containing the text 'Conclusion'
Optional
model
gpt-4o
Optional
Examples
1. Extracting by Page Numbers
2. Extracting by Page Markers
Included End Marker
Excluded End Marker
3. Extracting by Page Numbers with OpenAI Model
4. Extracting by Start Marker Only
Last updated
Was this helpful?