---
title: "OcrSettings"
canonical_url: "https://www.nutrient.io/api/python/settings/vision/advanced/ocr-settings/"
md_url: "https://www.nutrient.io/api/python/settings/vision/advanced/ocr-settings.md"
last_updated: "2026-08-11T08:57:05.212Z"
description: "Settings for Ocr. Values fall back through three levels: document → SDK → built-in default."
---

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.

**Tags:** `Vision`, `Advanced`

```python

from nutrient_sdk import OcrSettings

```

## Construction

`OcrSettings` is accessed through a [`Document`](/api/python/document/) instance for per-document overrides, or via [`SdkSettings`](/api/python/settings/document/sdk-settings/) for SDK-wide defaults.

```python

# Per-document override

with Document.open("input.pdf") as doc:
    settings = doc.settings.ocr_settings
    settings.some_field = new_value          # mutate fields directly

# SDK-wide default (applies to all documents)

SdkSettings.ocr_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.ocr_settings = other_settings` is rejected.

## Properties

### default_languages

```python

@property
def default_languages(self) -> str

@default_languages.setter
def default_languages(self, value: str) -> None

```

Default OCR languages to use (comma-separated language codes).

**Type:** `str`

**Default:** `"eng"`

---

### enable_preprocessing

```python

@property
def enable_preprocessing(self) -> bool

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

```

Indicates whether to enable image preprocessing before OCR.

**Type:** `bool`

**Default:** `true`

---

### enable_skew_detection

```python

@property
def enable_skew_detection(self) -> bool

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

```

Indicates whether to enable automatic skew detection and correction.

**Type:** `bool`

**Default:** `true`

---

### enable_table_detection

```python

@property
def enable_table_detection(self) -> bool

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

```

Indicates whether to detect and extract tables from OCR output.

**Type:** `bool`

**Default:** `true`

---

### favor_accuracy

```python

@property
def favor_accuracy(self) -> bool

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

```

Indicates whether to favor accuracy over speed in OCR processing.

**Type:** `bool`

**Default:** `true`

---

### max_languages

```python

@property
def max_languages(self) -> int

@max_languages.setter
def max_languages(self, value: int) -> None

```

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`

**Default:** `1`

---

### max_scripts

```python

@property
def max_scripts(self) -> int

@max_scripts.setter
def max_scripts(self, value: int) -> None

```

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`

**Default:** `1`

---

### min_language_vote_fraction

```python

@property
def min_language_vote_fraction(self) -> float

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

```

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:** `float`

**Default:** `0.2`

---

### min_language_votes

```python

@property
def min_language_votes(self) -> int

@min_language_votes.setter
def min_language_votes(self, value: int) -> None

```

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`

**Default:** `2`

---

### min_script_ratio

```python

@property
def min_script_ratio(self) -> float

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

```

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:** `float`

**Default:** `0.2`

---

---

## Related pages

- [Advanced](/api/python/settings/vision/advanced.md)
- [Per-document override](/api/python/settings/vision/advanced/ai-augmenter-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/ai-processing-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/claude-api-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/content-extraction-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/custom-vlm-api-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/deskew-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/document-layout-json-export-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/finalizer-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/form-labeling-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/form-recognition-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/google-api-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/handwriting-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/inference-layout-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/open-ai-api-endpoint-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/open-ai-languages-detection-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/open-ai-picture-alt-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/reading-order-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/segmenter-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/table-recognition-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/vision-acceleration-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/vision-descriptor-settings.md)
- [Per-document override](/api/python/settings/vision/advanced/words-detection-settings.md)

