FormRecognitionSettings
Settings for FormRecognition. 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 FormRecognitionSettingsConstruction
FormRecognitionSettings 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.form_recognition_settings settings.some_field = new_value # mutate fields directly
# SDK-wide default (applies to all documents)SdkSettings.form_recognition_settings.some_field = new_valueSettings are configured by writing to fields on the returned object. The settings property itself cannot be reassigned — doc.settings.form_recognition_settings = other_settings is rejected.
Properties
checkbox_logit_bias
@propertydef checkbox_logit_bias(self) -> float
@checkbox_logit_bias.setterdef checkbox_logit_bias(self, value: float) -> NoneLogit bias applied to the Checkbox class before sigmoid during postprocessing. Positive values increase Checkbox detections, negative values suppress them. Default 0 (no bias).
Type: float
Default: 0f
confidence_threshold
@propertydef confidence_threshold(self) -> float
@confidence_threshold.setterdef confidence_threshold(self, value: float) -> NoneConfidence threshold for form field predictions that always exist as real fields, independent of the Specialist form-field VLM. This value has moved twice before (0.5 -> 0.35 -> 0.2), each time lowered because the 3-class form-field-v1 medium detector was observed to surface real-form fields at lower confidence than the synthetic benchmark implied. Default 0.35 (not the original, never-validated-on-real-documents 0.5 spec default) restores some of that precision, which is only safe because low_confidence_threshold now exists to recover genuinely weak-but-real fields when the VLM independently corroborates one geometrically (see FormVlmCorrelator’s three-phase matching) — raising this value without that corroboration path would reintroduce the exact recall loss this setting was lowered twice to avoid.
Type: float
Default: 0.35f
low_confidence_threshold
@propertydef low_confidence_threshold(self) -> float
@low_confidence_threshold.setterdef low_confidence_threshold(self, value: float) -> NoneA second, much lower confidence floor for form field predictions that must NEVER be trusted on their own and must NEVER be written to the DocumentGraph — candidates between this value and confidence_threshold only ever become real fields when the Specialist form-field VLM independently corroborates one geometrically (FormVlmCorrelator phase 3). This is what lets confidence_threshold sit higher (fewer uncorroborated false positives) without losing recall on genuinely real fields the detector alone is unsure about. Must be <= confidence_threshold; default 0.1 (tuned after field testing).
Type: float
Default: 0.1f
model_path
@propertydef model_path(self) -> str
@model_path.setterdef model_path(self, value: str) -> NonePath to the ONNX RF-DETR model file (model.onnx).
Type: str
Default: GetDefaultModelPath()
num_select
@propertydef num_select(self) -> int
@num_select.setterdef num_select(self, value: int) -> NoneNumber of top predictions to select during postprocessing. Default is 300 as specified in the RF-DETR configuration.
Type: int
Default: 300
signature_logit_bias
@propertydef signature_logit_bias(self) -> float
@signature_logit_bias.setterdef signature_logit_bias(self, value: float) -> NoneLogit bias applied to the Signature class before sigmoid during postprocessing. Positive values increase Signature detections, negative values suppress them. Default 0 (no bias).
Type: float
Default: 0f
text_logit_bias
@propertydef text_logit_bias(self) -> float
@text_logit_bias.setterdef text_logit_bias(self, value: float) -> NoneLogit bias applied to the Text class before sigmoid during postprocessing. Positive values increase Text detections, negative values suppress them. Default 0 (no bias).
Type: float
Default: 0f
use_cpu_only
@propertydef use_cpu_only(self) -> bool
@use_cpu_only.setterdef use_cpu_only(self, value: bool) -> NoneEnable CPU mode for ONNX. When true, forces CPU execution. When false, attempts to use GPU if available (CUDA/MPS).
Type: bool
Default: false