---
title: "DocumentClassificationSettings"
canonical_url: "https://www.nutrient.io/api/python/settings/vision/document-classification-settings/"
md_url: "https://www.nutrient.io/api/python/settings/vision/document-classification-settings.md"
last_updated: "2026-07-15T14:46:57.766Z"
description: "Settings for DocumentClassification. Values fall back through three levels: document → SDK → built-in default."
---

Settings for DocumentClassification. 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`

```python

from nutrient_sdk import DocumentClassificationSettings

```

## Construction

`DocumentClassificationSettings` 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.document_classification_settings
    settings.some_field = new_value          # mutate fields directly

# SDK-wide default (applies to all documents)

SdkSettings.document_classification_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.document_classification_settings = other_settings` is rejected.

## Properties

### image_weight

```python

@property
def image_weight(self) -> float

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

```

Relative weight of the image branch in the fused prediction. Set to 0 to use the text branch alone. Default 0.5.

**Type:** `float`

**Default:** `0.5f`

---

### pooling_temperature

```python

@property
def pooling_temperature(self) -> float

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

```

Margin-weighted pooling temperature used by both branches to combine the per-chunk (text) and per-page (image) distributions into one. Higher values let the most distinctive chunk/page dominate more aggressively; values approaching 0 approach a plain average. Default 8.

**Type:** `float`

**Default:** `8f`

---

### text

```python

@property
def text(self) -> str

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

```

Document text for the text branch. When non-empty, this text is scored directly. When empty (default), the text is derived from the document by the extraction pipeline at the tier set by `Engine` (e.g. `AdaptiveOcr` for fast OCR, `Icr` for local layout models, `VlmEnhancedIcr` for VLM-enhanced) — multi-page documents are extracted in full. Set `TextWeight` to 0 to skip the text branch (and its extraction) entirely.

**Type:** `str`

**Default:** `string.Empty`

---

### text_weight

```python

@property
def text_weight(self) -> float

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

```

Relative weight of the text branch in the fused prediction. The fused probability for a label is `(TextWeight·Pt + ImageWeight·Pi) / (TextWeight + ImageWeight)`. Set to 0 to use the image branch alone. Default 0.5.

**Type:** `float`

**Default:** `0.5f`

---

### top_k

```python

@property
def top_k(self) -> int

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

```

Maximum number of ranked predictions to return. 0 (default) returns all candidates, ranked by fused probability descending.

**Type:** `int`

**Default:** `0`

---

---

## Related pages

- [Vision](/api/python/settings/vision.md)
- [Per-document override](/api/python/settings/vision/schema-generation-settings.md)
- [Per-document override](/api/python/settings/vision/vision-settings.md)

