This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /api/python/requests/classification-request.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. 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 ClassificationRequest

Construction

ClassificationRequest()

Creates a new ClassificationRequest instance with default settings.

Methods

add_candidate_label

def add_candidate_label(self, label: str) -> None
def add_candidate_label(self, label: str, description: str) -> None

Adds a candidate label with no description. Adding a label that is already present (case-insensitive) replaces the existing entry.

Parameters:

NameTypeDescription
labelstrThe short display name of the class (for example, “Invoice”). This is the name reported in the result.
description (optional)strLonger context that helps the matcher (for example, “An itemized bill listing goods or services and the total amount due”).