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 InferenceLayoutSettingsConstruction
InferenceLayoutSettings is accessed through a Document instance for per-document overrides, or via SdkSettings for SDK-wide defaults.
# Per-document overridewith 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_valueSettings 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
@propertydef confidence_threshold(self) -> float
@confidence_threshold.setterdef confidence_threshold(self, value: float) -> NoneDetection 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
@propertydef group_expansion_height_ratio(self) -> float
@group_expansion_height_ratio.setterdef group_expansion_height_ratio(self, value: float) -> NoneRecovery 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
@propertydef handwriting_layout_recovery(self) -> bool
@handwriting_layout_recovery.setterdef handwriting_layout_recovery(self, value: bool) -> NoneMaster 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
@propertydef harvest_confidence_floor(self) -> float
@harvest_confidence_floor.setterdef harvest_confidence_floor(self, value: float) -> NoneRecovery 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
@propertydef merge_recovered_fragments(self) -> bool
@merge_recovered_fragments.setterdef merge_recovered_fragments(self, value: bool) -> NoneWhen 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
@propertydef recovery_word_coverage_ceiling(self) -> float
@recovery_word_coverage_ceiling.setterdef recovery_word_coverage_ceiling(self, value: float) -> NoneRecovery 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
@propertydef under_segmentation_ink_threshold(self) -> float
@under_segmentation_ink_threshold.setterdef under_segmentation_ink_threshold(self, value: float) -> NoneRecovery 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