Extracts data from a document that contains complex or repeated elements ("sections"). In effect, a "section" defines a repeating document inside a document, with its own fields.
The following image shows an example of a document containing a group of "claims" sections:
For the preceding example, you can configure Sensible to return an
unprocessed_claims array, where each object in the array contains a
claimant_last_name, and other fields. For more information, see Claims loss run example.
You can define "horizontal" section groups, as shown in the preceding image, or you can define "vertical" section groups (
"direction":"vertical"), which use column layout detection rather than text matches to define sections.
The following image shows horizontal sections. For more information, see the following Parameters section, and see Section nuances.
The following image shows vertical sections. For more information, see the following Parameters section, and see Section nuances.
Tip: To extract repeated vertical section groups, nest them in a parent section group. For an example, see Advanced: nested columns example.
|id (required)||string||Specifies an ID for a group of sections to extract in the document area defined by the Range parameter. You can define an array of section groups, and you can nest sections inside of other sections.|
|range (required)||object||Specifies the document area from which to extract a group of sections. The Range parameter specifies both:|
- a group of repeated sections in an area of the document
- the start and end of each repeated section.
horizontal sections: The sections group can span pages and nonrepeating text. For example, in the preceding image, an "unprocessed_claims" section group can span month headings.
vertical sections: The section group can span pages. By default, the group can't span text that breaks the column format.
For the Range object's parameters, see the following table.
|sections||Specifies sections inside sections. Use this for complex sections that contain nested repeated elements, for example, a grid of tables. Each nested section searches for its range inside the parent section's range.|
|display||boolean. Default: true||Specifies to display the start and end of each section in a section group as brackets overlaid on the rendered PDF in the Sensible app. Useful for troubleshooting.|
See the following table for details about the Range object parameters:
|anchor (required)||Anchor object, or array of Match objects||Anchor parameters have a special meaning in the context of sections, as follows:|
start: Ignores anything in the document before this line. if undefined, Sensible searches for the section group starting at the beginning of the document
horizontal sections: Specifies both the start of the section group and the repeated starting line of each section. For example, in the preceding image, specify
vertical sections: Specifies the start of the section group. By default, Sensible recognizes columns as sections automatically. For more information, see Section nuances.
end: Ignores any anchor matches in the document after this line. For example, to extract solely September claims in the preceding image, specify
|stop||Anchor object, or array of Match objects||horizontal sections: Specifies the repeated end of the section after its anchor. For example, if you specify |
If you don't specify this parameter, each section ends at the top boundary of the next section's starting line (plus any offset). In this case, the last section in the group continues to the end of the document.
vertical sections: Specifies the end of the section group, and ignores lines that span multiple columns. If not specified, Sensible ends the section group at the first line that spans multiple columns. If the spanning lines occur mid-column, you can also configure the Line Filters parameter.
For more information, see Section nuances.
|requireStop||Boolean. default: false||horizontal sections: If true, the Stop parameter is required, and the section ends when it matches the Stop parameter, instead of the default behavior of ending at the next starting line specified in the anchor's Match parameter.|
Note Configure this parameter for horizontal sections when the starting line repeats in the section, to avoid ending the section before it completes. You don't need to configure this parameter if multiple starting line matches lie on one horizontal line in the section. In such a case, Sensible ignores any zero-height sections generated by this horizontal line's matches. For more information, see Multiple anchors in section.
vertical sections: N/A, not allowed for vertical sections.
|offsetY||number in inches||Specifies an offset from the anchor Match parameter. Positive values offset down the page, negative values offset up the page. |
horizontal sections: Specifies the number of inches to offset the section's top boundary from the anchor Match parameter. By default a section starts at the top boundary of the matched line. If you specify Offset Y, the section starts at that top boundary plus the offset. For example, configure this when the section lacks an easy-to-match first line.
vertical sections: Specifies the number of inches to offset the section group's top boundary from the anchor Match parameter. For example, configure this when when you want to exclude non-columnar text from a vertical section.
|stopOffsetY||number in inches||Specifies the number of inches to offset from the Stop parameter. |
horizontal sections: Offsets the section's end from the bottom boundary of the anchor's Stop parameter.
vertical sections: Offsets the section group's end from the bottom boundary of the anchor's Stop parameter.
Range parameters for columns
"direction":"vertical" in the Range object to define a "vertical" sections group, where each section is a column-like layout. For example, use vertical sections to extract tables nested in tables, tables with row labels, or other complex text layouts.
The following table shows Range parameters specific to vertical sections.
|direction||If set to |
In detail, Sensible searches left-to-right for columns in the first-found document area defined by the Range parameter, rather than the default behavior of continuing to search for matches for the Range parameter. For an illustration of this behavior, see section nuances.
|columnSelection||array of index selections where each "index selection" can be:|
- a column index or comma-delimited indices
- an array with two comma-delimited indices, meaning all the columns in the indices range
default: capture all columns (
|Use to configure which columns to treat as sections. Sensible adds unselected columns to each section, for example so they can be used as anchor candidates. For an illustration, see Section nuances.|
|ignoredColumns||integer array.||Removes unwanted columns from both the output and from the SenseML search scope. For example, this is useful if the columns contain text that interferes with anchoring on other columns.|
|minColumnGap||number in inches. default: 0||Configures column recognition by specifying the smallest allowed width of the gutters separating the columns. For an example, see Table grid example. Use when text in a column contains whitespace gaps such that Sensible can split one column into two. To avoid this split, set a minimum gap that's larger than the gaps inside the column. The default (0) means that zero-width vertical lines define the column boundaries.|
|lineFilters||Match object, or array of Match objects||Use to ignore lines that span columns and break column recognition. For example, if the lines occur mid-column, use this parameter rather than a Stop parameter to exclude the lines. Sensible excludes the lines both from the output and from the SenseML search scope.|
You don't need to configure this parameter if you specify a Stop parameter. For more information, see Section nuances.
See the following topics:
Advanced: Nested columns example
Advanced: Nested table example
Advanced: Table grid example
Advanced: Zip sections example
Advanced: Zip and flatten nested sections
Updated about 10 hours ago