This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /api/python/settings/vision/advanced/inference-layout-settings.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. InferenceLayoutSettings

Settings for InferenceLayout. Values fall back through three levels: document → SDK → built-in default. Writes target the document only when set on a document’s settings, otherwise the SDK globally when set on SdkSettings.

Tags: Vision, Advanced

from nutrient_sdk import InferenceLayoutSettings

Construction

InferenceLayoutSettings is accessed through a Document instance for per-document overrides, or via SdkSettings for SDK-wide defaults.

# Per-document override
with Document.open("input.pdf") as doc:
settings = doc.settings.inference_layout_settings
settings.some_field = new_value # mutate fields directly
# SDK-wide default (applies to all documents)
SdkSettings.inference_layout_settings.some_field = new_value

Settings are configured by writing to fields on the returned object. The settings property itself cannot be reassigned — doc.settings.inference_layout_settings = other_settings is rejected.

Properties

confidence_threshold

@property
def confidence_threshold(self) -> float
@confidence_threshold.setter
def confidence_threshold(self, value: float) -> None

Detection confidence threshold (0.0 to 1.0). Detections with confidence below this threshold will be filtered out.

Type: float

Default: 0.5f


group_expansion_height_ratio

@property
def group_expansion_height_ratio(self) -> float
@group_expansion_height_ratio.setter
def group_expansion_height_ratio(self, value: float) -> None

Recovery grouping: proximity-cluster expansion as a multiple of a box’s height (bridges lines within a block). Larger merges more aggressively.

Type: float

Default: 0.6f


handwriting_layout_recovery

@property
def handwriting_layout_recovery(self) -> bool
@handwriting_layout_recovery.setter
def handwriting_layout_recovery(self, value: bool) -> None

Master switch for handwriting layout recovery: on pages the detector under-segments, harvest its sub-threshold boxes and consolidate them into block zones. Default on — the gate is selective (it fires only on genuinely under-segmented pages), the recovery is additive (it only adds blocks over un-zoned space, never replaces refined zones), and it is measured ParseBench-neutral on printed documents while recovering handwriting the detector would otherwise lose entirely.

Type: bool

Default: true


harvest_confidence_floor

@property
def harvest_confidence_floor(self) -> float
@harvest_confidence_floor.setter
def harvest_confidence_floor(self, value: float) -> None

Recovery harvest: on a triggered page, keep detections down to this confidence. The detector’s internal detection floor is max(confidence_threshold - 0.2, 0.1). Detections below that floor are unavailable for recovery, even if this setting is lower. At the default confidence_threshold of 0.5, the effective recovery floor is therefore at least 0.3. Set this below confidence_threshold to recover sub-threshold detections.

Type: float

Default: 0.2f


merge_recovered_fragments

@property
def merge_recovered_fragments(self) -> bool
@merge_recovered_fragments.setter
def merge_recovered_fragments(self, value: bool) -> None

When set (the default), a small recovered fragment that continues an adjacent same-row text zone is MERGED into that zone (extending it) instead of standing alone, and the VLM crop of any zone masks the picture regions it overlaps so the merged rectangle is read as its true (non-rectangular) content. Clear it to keep recovered zones disjoint from the detector’s zones (no merge, no crop masking).

Type: bool

Default: true


recovery_word_coverage_ceiling

@property
def recovery_word_coverage_ceiling(self) -> float
@recovery_word_coverage_ceiling.setter
def recovery_word_coverage_ceiling(self, value: float) -> None

Recovery discriminator: skip recovery when the fraction of the page’s recognised words already covered by the kept (>= ConfidenceThreshold) zones meets or exceeds this value. A well-segmented printed/complex page has high word coverage even when non-text ink (charts, figures) sits outside the zones, so this suppresses the ink gate’s false positives; an under-segmented handwriting scan has near-zero covered words and still recovers. Ignored when HandwritingLayoutRecovery is off.

Type: float

Default: 0.6f


under_segmentation_ink_threshold

@property
def under_segmentation_ink_threshold(self) -> float
@under_segmentation_ink_threshold.setter
def under_segmentation_ink_threshold(self, value: float) -> None

Recovery gate: trigger when the fraction of text-like ink OUTSIDE the kept (>= ConfidenceThreshold) zones exceeds this value. Higher = fires on fewer pages. Ignored when HandwritingLayoutRecovery is off.

Type: float

Default: 0.35f