Skip to main content

Segment Types

Chunkr identifies the following segment types during layout analysis:
SegmentType
Main title or heading of the document.
SegmentType
Section headers and subheadings within the document.
SegmentType
Regular paragraph text.
SegmentType
Individual items in bulleted or numbered lists.
SegmentType
Tabular data.
SegmentType
Images, diagrams, and figures.
SegmentType
Captions for images, tables, or other elements.
SegmentType
Mathematical formulas and equations.
SegmentType
Footnotes and endnotes.
SegmentType
Headers that appear at the top of pages.
Footers that appear at the bottom of pages.
SegmentType
An entire page treated as a single segment (when using Page segmentation strategy).

Segment Processing

The SegmentProcessing configuration allows you to control how each segment type is processed and which content representations are generated.

Configuration Structure

Each segment type can have its own processing configuration:

AutoGenerationConfig

Used for most segment types (Title, SectionHeader, Text, ListItem, Caption, Footnote, PageHeader, PageFooter).
SegmentFormat
default:"Markdown"
Specifies the output format.
GenerationStrategy
default:"Auto"
Determines how the content is generated.
CroppingStrategy
default:"Auto"
Controls whether to crop the page image to the segment’s bounding box.
string
Custom prompt for LLM-based processing of this segment. Only used when LLM processing is enabled for the segment.
EmbedSource[]
default:"[Content]"
Defines which content sources will be included in the chunk’s embed field and counted towards the chunk length. The array’s order determines the sequence in which content appears.
boolean
default:false
Use the full page image as context for LLM generation.

Deprecated Fields

GenerationStrategy
deprecated
DEPRECATED: Use format: Html and strategy instead.
GenerationStrategy
deprecated
DEPRECATED: Use format: Markdown and strategy instead.

LlmGenerationConfig

Used for Formula and Page segment types. Has the same fields as AutoGenerationConfig but with strategy defaulting to LLM.
SegmentFormat
default:"Markdown"
Output format (Html or Markdown).
GenerationStrategy
default:"LLM"
Generation strategy (Auto or LLM).
CroppingStrategy
default:"Auto"
Image cropping strategy.
string
Custom LLM prompt.
EmbedSource[]
default:"[Content]"
Content sources for embedding.
boolean
default:false
Use full page image as context.

TableGenerationConfig

Used specifically for Table segments. Has the same fields as AutoGenerationConfig but with different defaults.
SegmentFormat
default:"Html"
Output format (Html or Markdown). Tables default to HTML for better structure preservation.
GenerationStrategy
default:"LLM"
Generation strategy. Tables default to LLM for higher accuracy.
CroppingStrategy
default:"Auto"
Image cropping strategy.
string
Custom LLM prompt.
EmbedSource[]
default:"[Content]"
Content sources for embedding.
boolean
default:false
Use full page image as context.

PictureGenerationConfig

Used specifically for Picture segments.
SegmentFormat
default:"Markdown"
Output format (Html or Markdown).
GenerationStrategy
default:"Auto"
Generation strategy.When set to Auto, generates image tags:
  • HTML format: <img src="{url}" />
  • Markdown format: ![Image]({url})
PictureCroppingStrategy
default:"All"
Controls image cropping for pictures.
string
Custom LLM prompt for describing or processing the image.
EmbedSource[]
default:"[Content]"
Content sources for embedding.
boolean
default:false
Use full page image as context.

Example Configuration