liveBook · Manning

Single-label categorical classification

As explained in Building LLM Applications with DSPy

A single-label problem is a classification setup in which each input is assigned at most one class label.

In single-label classification, each input is assigned at most one class. This is separate from the binary-versus-multiclass distinction, which depends on the number of possible classes. section 3.1.2

Intent classification

An utterance asking for a flight and food options contains two intents, so it does not fit a single-label setup. In the ATIS data, combined-intent classes are removed to simplify classification. section 3.1.2 section 3.2

Listing 3.3 Mapping the intents to their new names
df['intent'] = df['intent'].map(ATIS_INTENT_MAPPING)  #1
df = df.dropna(subset=['intent'])  #2
print(f"DF number of rows after removing multi label classes: {len(df)}")

The mapping and row filtering show how combined-intent classes are excluded when preparing the ATIS labels. section 3.2

How Building LLM Applications with DSPy covers it

How deep it goes
Defines label cardinality, gives a multi-intent counterexample, and notes that the simpler setup can be too limiting.
Examples
Uses a flight-and-meals request as a multi-intent counterexample and removes combined-intent classes from ATIS.
What you can do after
Apply the single-label assumption by excluding combined-intent classes when preparing an ATIS intent classifier.
How it connects
Distinguishes single-label from multilabel classification and relates class counts to binary and multiclass classification.

Also explained in

Compare how 2 books explain single-label categorical classification →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building LLM Applications with DSPy. The section links point to the parts of the book it draws on.