---
title: "ClassificationRequest"
canonical_url: "https://www.nutrient.io/api/csharp/requests/classification-request/"
md_url: "https://www.nutrient.io/api/csharp/requests/classification-request.md"
last_updated: "2026-10-08T08:55:57.713Z"
description: "Describes a zero-shot classification request for `Classify`: the candidate labels the document is scored against."
---

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.

```csharp

using Nutrient;

```

## Construction

```csharp

public ClassificationRequest()

```

## Methods

### AddCandidateLabel

```csharp

public void AddCandidateLabel(string label)

```

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

**Parameters**

| Name    | Type     | Description                                                                                            |
| ------- | -------- | ------------------------------------------------------------------------------------------------------ |
| `label` | `string` | The short display name of the class (for example, "Invoice"). This is the name reported in the result. |

```csharp

public void AddCandidateLabel(string label, string description)

```

Adds a candidate label with a description. The label is the short name shown in the result; the description is longer context used only to improve matching and never appears in the output. Labels and descriptions may contain any characters. Adding a label that is already present (case-insensitive) replaces the existing entry.

**Parameters**

| Name          | Type     | Description                                                                                                                 |
| ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
| `label`       | `string` | The short display name of the class (for example, "Invoice"). This is the name reported in the result.                      |
| `description` | `string` | Longer context that helps the matcher (for example, "An itemized bill listing goods or services and the total amount due"). |

## Resource management

```csharp

public void Dispose()

```

`ClassificationRequest` 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.

---

## Related pages

- [Requests](/api/csharp/requests.md)
- [Schema Generation Request](/api/csharp/requests/schema-generation-request.md)
- [Structured Extraction Request](/api/csharp/requests/structured-extraction-request.md)

