ClassificationRequest
Describes a zero-shot classification request for Classify: the candidate labels the document is scored against. Each label optionally carries a longer description that gives the matcher more context; the description never appears in the result. At least two labels are required — classification is zero-shot, so the labels define the entire output space, and a single label would trivially win with probability 1.
Branch weights, supplied text, and the other classification knobs are controlled separately via DocumentClassificationSettings on the document’s settings.
from nutrient_sdk import ClassificationRequestConstruction
ClassificationRequest()Creates a new ClassificationRequest instance with default settings.
Methods
add_candidate_label
def add_candidate_label(self, label: str) -> Nonedef add_candidate_label(self, label: str, description: str) -> NoneAdds a candidate label with no description. Adding a label that is already present (case-insensitive) replaces the existing entry.
Parameters:
| Name | Type | Description |
|---|---|---|
label | str | The short display name of the class (for example, “Invoice”). This is the name reported in the result. |
description (optional) | str | Longer context that helps the matcher (for example, “An itemized bill listing goods or services and the total amount due”). |