Settings for Ocr. 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.
using Nutrient;The SDK creates this class through factory methods or other SDK objects.
Properties
DefaultLanguages
public string DefaultLanguages { get; set; }OCR languages, as language codes joined with ’+’ (for example “eng+deu”). The default, “auto”, detects the document’s language (script identification, then language identification of the page’s text) and reads the document in it; by default the first page in which a language is identified decides for the whole document. Pipelines without a detection step read “auto” as English. Naming the languages skips the detection pass, which reads the page one more time and so adds time to each document.
Type: string
DetectLanguageFavorAccuracy
public bool DetectLanguageFavorAccuracy { get; set; }Indicates whether the automatic language-detection pass favors recognition accuracy over speed. The text this pass recognizes is never returned to the caller — it only feeds the language identifier, which reads word shape and character n-grams and tolerates per-character noise. Favoring accuracy therefore runs extra recognition passes refining glyph detail that nothing downstream reads. Enable it for the small share of pages whose language is identified from marginal text, at roughly a quarter more detection time. This is independent of FavorAccuracy, which governs the OCR whose text is returned.
Type: bool
DetectLanguageFirstIdentifiedPageDecides
public bool DetectLanguageFirstIdentifiedPageDecides { get; set; }Indicates whether, when DetectLanguageOncePerDocument is enabled, a page whose automatic language detection finds no language (a blank, image-only or unreadable page) leaves the document’s language to the next page instead of deciding it. The first page that finds a language then decides for the rest of the document. Disable it to let the first page decide, as before.
Type: bool
DetectLanguageFromDigitalText
public bool DetectLanguageFromDigitalText { get; set; }Controls whether the language of born-digital text (pages whose text comes from the document itself, so no OCR runs) is identified offline even when DefaultLanguages names a language. The identification reads a sample of the page text, costs no OCR pass, and only selects the per-language lexicon used when the document is exported as text (compound hyphens at line wraps); OCR of any scanned page keeps DefaultLanguages. It has no effect when DefaultLanguages is "auto", where detection runs for every page anyway. Off by default: an explicit language is honoured as given.
Type: bool
DetectLanguageOncePerDocument
public bool DetectLanguageOncePerDocument { get; set; }Indicates whether automatic language detection (the "auto" OCR language) runs once for the whole document instead of once per page. When enabled, the first page that needs a language runs the detection and every other page of the same document reuses that result, so a document pays the detection cost once rather than once per page. Disable it to detect every page independently — what a document whose pages are in different languages needs — at the cost of a full page recognition pass per page.
Type: bool
DetectLanguagePageFraction
public double DetectLanguagePageFraction { get; set; }The share of a page (0.0 to 1.0) the automatic language-detection pass reads text from. 0 reads the whole page; a smaller share reads a centered band of the page, full width. Recognition cost scales with the amount of text read, so a band is faster, but on pages whose middle is a table of codes and figures, such as invoices, it identifies the language less often. A band that yields too little text falls back to the whole page. Orientation and script detection always read the whole page. Set it to 0.5 to read the middle half of the page, for about a fifth less detection time.
Type: double
DetectLanguagePairWithEnglish
public bool DetectLanguagePairWithEnglish { get; set; }Indicates whether automatic language detection reads a page written in a Latin-script language with English as well, for example Spanish as “spa+eng”. The recognizer retries doubtful words with the second language. The detected languages reported for the page are unchanged, and pages in other scripts are read as detected.
Type: bool
DetectLanguageScriptCheck
public bool DetectLanguageScriptCheck { get; set; }Indicates whether automatic language detection checks each non-Latin script against the Latin one. For each non-Latin script the orientation-and-script pass names, the detection text is read with that script’s model alone and with the Latin model alone, and the Latin model replaces the script when its read’s mean word confidence is higher by at least DetectLanguageScriptCheckMargin. It catches Latin scans the script pass mistakes for Cyrillic, Arabic or Greek. At the default MaxScripts of 1, it costs one more read of the detection band on pages named non-Latin; above 1, it reads the band once more with each non-Latin script named and once with Latin. Disable it to trust the script pass as before.
Type: bool
DetectLanguageScriptCheckMargin
public double DetectLanguageScriptCheckMargin { get; set; }How much higher, from 0.0 to 1.0, the Latin read’s mean word confidence must be for the script check to replace a script with Latin. See DetectLanguageScriptCheck.
Type: double
DetectLanguageTopGuessFloor
public double DetectLanguageTopGuessFloor { get; set; }The probability, from 0.0 to 1.0, from which automatic language detection keeps the language identifier’s best guess when it identifies no language reliably. The guess is kept only when its language is written in the script the page was read in; otherwise, and below this value, the page is read in English. The identifier calls a language reliable from 0.7, so 1 keeps no guess, the previous behavior.
Type: double
EnableMrzReading
public bool EnableMrzReading { get; set; }Reads the machine readable zones of passports, identity cards and visas a second time with a dedicated reader. Its reading replaces the zone’s text when something vouches for it: every check digit is right, OCR read the zone exactly as the reader did, or every check digit it fails covers characters OCR read alike. Unless OCR read it alike, the zone is read again at two other scales: a reading the rereads do not repeat gets a lowered confidence, and a reading nothing vouches for but that both rereads repeat replaces the text with a lowered confidence. Otherwise the zone keeps the text OCR read, with a lowered confidence unless that text passes its check digits itself. Rows that look like a zone OCR garbled are read too, and change the text only when their reading is vouched for or repeated. Text-layer words are never changed.
Type: bool
EnableOrientationDetection
public bool EnableOrientationDetection { get; set; }Indicates whether the OCR engine detects and compensates page orientation (90°/180°/270°) during recognition. The recognized text layout carries the correction; the source image or page is not rotated.
Type: bool
EnablePreprocessing
public bool EnablePreprocessing { get; set; }Indicates whether to enable image preprocessing before OCR.
Type: bool
EnableSkewDetection
public bool EnableSkewDetection { get; set; }Indicates whether to enable automatic skew detection and correction.
Type: bool
EnableTableDetection
public bool EnableTableDetection { get; set; }Indicates whether to detect and extract tables from OCR output.
Type: bool
Engine
public OcrEngine Engine { get; set; }Which OCR engines read a page. The default, Fusion, reads with every engine the host can run and reconciles their readings. Primary and Secondary read with one engine, for diagnostics and benchmark arms.
Type: OcrEngine
ExperimentalCharacterGraderCorpusPath
public string ExperimentalCharacterGraderCorpusPath { get; set; }Path to the experimental character-grader causal text corpus used to train the in-process character predictor.
Type: string
ExperimentalCharacterGraderDictionaryPath
public string ExperimentalCharacterGraderDictionaryPath { get; set; }Path to the experimental character-grader dictionary (one character per line, an empty line for space) matching the visual model’s class order.
Type: string
ExperimentalCharacterGraderModelPath
public string ExperimentalCharacterGraderModelPath { get; set; }Path to the experimental character-grader visual model used by OCR evidence reconciliation. The grader stays disabled while this is empty; it must be configured together with the dictionary and corpus paths.
Type: string
ExperimentalEvidenceCorruptionSeed
public int ExperimentalEvidenceCorruptionSeed { get; set; }Research probe: seeded deterministic corruption of digit-bearing OCR evidence words. Co-located readings from ALL engines receive the IDENTICAL single-digit confusion substitution, simulating the correlated-error class that word-level agreement cannot detect - the harness that grades unanimity-audit discriminators. Zero (the default) disables the probe. Never enable outside qualification runs.
Type: int
ExperimentalFusionAgreementWeight
public double ExperimentalFusionAgreementWeight { get; set; }Cross-engine agreement feature weight of the experimental OCR evidence reconciliation policy.
Type: double
ExperimentalFusionConfidenceWeight
public double ExperimentalFusionConfidenceWeight { get; set; }Confidence feature weight of the experimental OCR evidence reconciliation policy. Weights are normalized against each other. Ablation knob for the evidence-fusion experiment; not a production mode.
Type: double
ExperimentalFusionConfirmationThreshold
public double ExperimentalFusionConfirmationThreshold { get; set; }Minimum candidate score for the experimental OCR evidence reconciliation to confirm a canonical reading instead of disputing the group.
Type: double
ExperimentalFusionDigitGrouping
public bool ExperimentalFusionDigitGrouping { get; set; }Rewrites the thousands marks of an amount that carries the page’s decimal mark twice (“5.262.000” on a page that writes “10,418.76”), when the page groups thousands with the other mark elsewhere. Without it, OCR fusion moves a mark to the page’s convention only where an engine read that mark.
Type: bool
ExperimentalFusionFoldFullwidthLatin
public bool ExperimentalFusionFoldFullwidthLatin { get; set; }Folds fullwidth Latin forms in reconciled canonical text to ASCII. Raw evidence words keep the original reading. Enable only for Latin-script documents.
Type: bool
ExperimentalFusionGenericSubreadDomination
public bool ExperimentalFusionGenericSubreadDomination { get; set; }Confirms a generic-text dispute for the candidate whose tokens strictly extend every competitor’s, instead of letting the fixed source preference delete the extra tokens. Accuracy-batch knob of the evidence-fusion experiment.
Type: bool
ExperimentalFusionJudge
public bool ExperimentalFusionJudge { get; set; }Indicates whether a CTC text recognizer judges words two readings disagree on: a word two OCR engines read differently when their evidence leaves the choice open, and a word the VLM reads differently from OCR in the situations where such a judge was measured to beat the VLM (letters two OCR engines agree on, and digits a single engine read). The judge loads its model on the first word it judges, and reads with the published judge model unless ExperimentalFusionJudgeModelPath names another one.
Type: bool
ExperimentalFusionJudgeDictionaryPath
public string ExperimentalFusionJudgeDictionaryPath { get; set; }Path to the line-delimited character dictionary of ExperimentalFusionJudgeModelPath: one character per line, in the model’s class order after the CTC blank.
Type: string
ExperimentalFusionJudgeModelPath
public string ExperimentalFusionJudgeModelPath { get; set; }Path to a CTC text-recognition model (ONNX) that replaces the published fusion-judge model. It must be configured together with ExperimentalFusionJudgeDictionaryPath.
Type: string
ExperimentalFusionMinimumWinnerMargin
public double ExperimentalFusionMinimumWinnerMargin { get; set; }Minimum score margin between the best and second-best candidate for the experimental OCR evidence reconciliation to confirm a canonical reading.
Type: double
ExperimentalFusionPaddleFullBranch
public bool ExperimentalFusionPaddleFullBranch { get; set; }Runs the full-Paddle detection-plus-recognition branch as a third evidence source in the experimental OCR evidence pipeline. The branch shares its recognition model with the FAST+Paddle branch, so its vote is correlated. The 200-doc rasterized ablation measured zero marginal accuracy for the branch (0.9398 vs 0.9397, 5 docs moved, largest movement +0.016 in favor of dropping it) against a full extra Paddle detection-plus-recognition pass per page, so it is off by default.
Type: bool
ExperimentalFusionPaddleOnOriginalImage
public bool ExperimentalFusionPaddleOnOriginalImage { get; set; }Research knob: when evidence fusion runs, the FAST + Paddle branch reads the page image BEFORE preprocessing (the deskewed original) instead of the same preprocessed image Tesseract reads. Two engines fed one preprocessed view share that view’s failures; decorrelating the inputs is the only decorrelation lever a two-fixed-engine system has.
Type: bool
ExperimentalFusionSecondaryBudgetFactor
public double ExperimentalFusionSecondaryBudgetFactor { get; set; }Wall-time budget for the secondary evidence branches as a multiple of the primary branch’s wall time. Zero, the default, disables the budget. A wall-clock budget cannot tell a slow page from a busy machine: it counts the time the GPU branch waits behind other pages’ GPU work and the GPU’s first-run warm-up, while the CPU primary keeps its speed. With four pages in flight on one GPU it cancelled the Paddle branch on a fifth of scanned pages, and on nearly all of them with three processes sharing the GPU. Set it only to cap the latency of one document at a time.
Type: double
ExperimentalFusionSecondaryBudgetFloorSeconds
public double ExperimentalFusionSecondaryBudgetFloorSeconds { get; set; }Lower bound of the secondary evidence budget in seconds, when ExperimentalFusionSecondaryBudgetFactor enables the budget.
Type: double
ExperimentalFusionSingleSourceConfidenceFloor
public double ExperimentalFusionSingleSourceConfidenceFloor { get; set; }Minimum mean confidence for a single-engine evidence group to be confirmed as page text. Zero disables the gate.
Type: double
ExperimentalFusionSpaceInsensitiveAgreement
public bool ExperimentalFusionSpaceInsensitiveAgreement { get; set; }Counts generic-text agreement on letter/digit content so segmentation variants of the same word agree instead of disputing; the fewest-token rendering is emitted.
Type: bool
ExperimentalFusionStagedMaxLowConfidenceRatio
public double ExperimentalFusionStagedMaxLowConfidenceRatio { get; set; }Maximum fraction of low-confidence primary words for the staged safe gate.
Type: double
ExperimentalFusionStagedMinMeanConfidence
public double ExperimentalFusionStagedMinMeanConfidence { get; set; }Minimum primary mean word confidence for the staged safe gate. Real tesseract confidences on 200-dpi scans cluster near 0.95 even on clean pages; 0.96 fires on only the most confident ~5% and measured accuracy-neutral, while 0.95 fires on ~20% for -15% mean time at a small measured table-accuracy cost.
Type: double
ExperimentalFusionStagedMinWordCount
public int ExperimentalFusionStagedMinWordCount { get; set; }Minimum primary word count for the staged safe gate.
Type: int
ExperimentalFusionStagedSecondEngine
public bool ExperimentalFusionStagedSecondEngine { get; set; }Cancels the secondary (Paddle) evidence branches when the primary (tesseract) read passes the safe gate (enough words, high mean confidence, tiny low-confidence tail). The catastrophic pages fusion rescues are near-empty or low-confidence tesseract reads, which never pass the gate. Staged-fusion speed knob.
Type: bool
ExperimentalFusionValidShapeWeight
public double ExperimentalFusionValidShapeWeight { get; set; }Valid-field-shape feature weight of the experimental OCR evidence reconciliation policy.
Type: double
ExperimentalPaddleOnCpu
public bool ExperimentalPaddleOnCpu { get; set; }Benchmarking aid: lets the FAST and Paddle recognition stages run on the CPU where they otherwise require a GPU execution provider, so a machine without a GPU follows the OCR routing of a GPU deployment (automatic engine selection picks Paddle, and OCR evidence fusion collects the FAST + Paddle reading). Same models, much slower; not for production.
Type: bool
ExperimentalRenderDpi
public int ExperimentalRenderDpi { get; set; }Research knob: DPI at which document pages are rendered for the vision pipeline. Zero (the default) keeps the pipeline’s own default (200). Used to measure whether a higher render resolution recovers text on low-resolution scans; not a product setting.
Type: int
ExperimentalUnanimityAuditActive
public bool ExperimentalUnanimityAuditActive { get; set; }Acts on the unanimity audit: a confirmed legal-field decision whose accepted reading loses the forced-alignment contest against a confusion rival is repaired to the rival the grader selects confidently, and otherwise demoted to low confidence. Requires ExperimentalUnanimityAuditProbe.
Type: bool
ExperimentalUnanimityAuditProbe
public bool ExperimentalUnanimityAuditProbe { get; set; }Research probe: forced-alignment audit of CONFIRMED legal-field decisions. For each confirmed fraction/identifier with a crop, the character grader scores the accepted string against single-digit confusion rivals and reports the log-likelihood ratio - measuring whether the crop evidence can discriminate correlated unanimous engine errors that word-level agreement cannot see. Diagnostics only; never changes output.
Type: bool
FavorAccuracy
public bool FavorAccuracy { get; set; }Indicates whether to favor accuracy over speed in OCR processing. When enabled, the recognizer runs additional passes (inverted-text detection and layout refinement) that improve results on difficult scans at the cost of processing time. Disable to favor speed, for example in high-volume batch OCR.
Type: bool
ImageTableZoneRead
public bool ImageTableZoneRead { get; set; }Reads a table that holds no words at all, such as a table pasted as an image on a born-digital page, through the evidence path a scanned page takes: every available engine reads the table, the readings are reconciled and disputed words graded. The table’s structure is decided as before; only its text changes.
Type: bool
MaxLanguages
public int MaxLanguages { get; set; }Maximum number of languages to report from offline language detection. The default, 1, reports only the dominant language (no language mixing). Raise it (e.g. 2) to detect multiple languages in one document, including two languages that share a script (such as English + French).
Type: int
MaxScripts
public int MaxScripts { get; set; }Maximum number of writing scripts to recognize on a page during offline language detection (and the “auto” OCR path). The default, 1, recognizes only the dominant script (no script mixing) — fastest, and the original behavior. Raise it (e.g. 2) to handle cross-script documents such as Cyrillic + Han, where the page is OCR’d with each detected script’s model.
Type: int
MaxThreads
public int MaxThreads { get; set; }The maximum number of pages processed concurrently when a document-level OCR operation (such as making a document searchable) runs over multiple pages. Set to 0 to use one thread per available processor. Values below 1 (other than 0) are treated as 1.
Type: int
MinLanguageVoteFraction
public double MinLanguageVoteFraction { get; set; }Consensus control for multi-language detection (only applies when MaxLanguages is greater than 1). A secondary language that is not present in the whole-page reading is reported only if the regions that detect it make up at least this fraction (0.0 to 1.0) of all regions. Works together with MinLanguageVotes to keep the extra language from being inferred from a negligible share of a long document.
Type: double
MinLanguageVotes
public int MinLanguageVotes { get; set; }Consensus control for multi-language detection (only applies when MaxLanguages is greater than 1). A secondary language that is not present in the whole-page reading is reported only if it is detected in at least this many text regions. Raising it improves precision — it suppresses a spurious extra language inferred from a single noisy region — at a small cost to recall of a genuine minority language that appears in only one region.
Type: int
MinScriptRatio
public double MinScriptRatio { get; set; }Minimum share of a page (0.0 to 1.0) a secondary writing script must occupy before the page is also read with that script’s model (only applies when MaxScripts is greater than 1). Raising it improves precision: it stops a faint, spurious script — often lookalike letters a second script’s model misreads from the dominant script — from being read at all, which is a common source of a wrongly reported extra language. The dominant script is always read.
Type: double
MrzReaderCallsPerLead
public int MrzReaderCallsPerLead { get; set; }The reader calls (locator searches, reads and rescans) the machine readable zone reading may make for one lead: a row that looks like a zone OCR garbled, which the reader locates, reads and rescans. A lead stopped before a call changes nothing. Zero or less sets no limit. Zones OCR read as zones are never limited. The limit counts calls, not time, so a page gives the same result on any machine.
Type: int
MrzReaderCallsPerPage
public int MrzReaderCallsPerPage { get; set; }The reader calls the machine readable zone reading may make for all the leads of a page together, in reading order (see MrzReaderCallsPerLead): a lead stopped before a call changes nothing, and the page’s later leads are not read. Zero or less sets no limit.
Type: int
PaperRelativeInkCut
public float PaperRelativeInkCut { get; set; }Fraction of the local paper level at and below which ink maps to black during normalization; levels between the cut and the paper keep a linear ramp. Measured on faint customer scans: 0.75 reads best (a yellow page: 10 of 12 reference strings against 6 at 0.55).
Type: float
PaperRelativeInkDepthThreshold
public float PaperRelativeInkDepthThreshold { get; set; }Median ink depth, as a fraction of the local paper level, below which Auto normalizes a page. Measured on customer scans: a yellow low-contrast page reads 0.19 and a faint grey page 0.10, while ordinary scans sit at 0.34 and above.
Type: float
PaperRelativeNoiseWhitePointFactor
public float PaperRelativeNoiseWhitePointFactor { get; set; }Multiple of the paper’s own variation (the spread between a tile’s paper level and its median brightness) below which a pixel still counts as paper during normalization. On mottled or speckled stock this maps the mottle to white instead of to gray speckle as dark as the strokes; flat paper has no spread, so its mapping is unchanged. 0 keeps the white point at the paper level. Measured on speckled customer goods receipts: 2.5 reads best.
Type: float
PaperRelativeNormalization
public PaperNormalizationMode PaperRelativeNormalization { get; set; }Whether the page image handed to OCR is first expressed relative to its local paper level. A high percentile of each region’s brightness is taken as that region’s paper, and every pixel is scored against its own paper: paper becomes white and ink darker than the ink cut becomes black, so tinted, faint, or unevenly lit scans read as cleanly as plain ones. Only the OCR input is changed; layout and picture detection keep the original image. In Auto mode a page is normalized only when its ink is shallow relative to its paper, so an ordinary scan stays byte-identical.
Type: PaperNormalizationMode
PaperRelativeNormalizationForPaddle
public bool PaperRelativeNormalizationForPaddle { get; set; }Whether the Paddle branches of OCR evidence fusion also read the paper-relative view of a normalized page. By default only Tesseract does and Paddle reads the page as rendered: measured with both engines on 120 customer pages, normalizing Paddle’s input too gained nothing on average and lost values on 11 pages (a yellow invoice and speckled receipts read worse), where Tesseract-only normalization lost on 1.
Type: bool
PaperRelativePaperPercentile
public int PaperRelativePaperPercentile { get; set; }Percentile of a tile’s brightness taken as that tile’s paper level.
Type: int
PaperRelativeTileSize
public int PaperRelativeTileSize { get; set; }Side of the square tiles, in pixels, the paper level is sampled in.
Type: int
SplitDecimalRepair
public bool SplitDecimalRepair { get; set; }In a table column of decimal numbers, restores the decimal point OCR read as a gap (“0 682” for 0.682) when the column’s other numbers share the decimal format the repair produces. Text-layer words are never changed.
Type: bool
Resource management
public void Dispose()OcrSettings implements IDisposable. Call Dispose() or use a C# using declaration to release its native handle right away. If you don’t, the handle is released when the object is garbage collected.