01Chapter 1: Why zero-shot: the cost of labeled dataThis chapter assumes basic Python, familiarity with supervised text classification, and a general idea of pretrained language models. You should know that a classifier maps an input, such as a message, to one or more categories.2 min read
03Chapter 3: Natural language inference: premise, hypothesis, entailmentThis chapter assumes basic Python, familiarity with supervised text classification, and a general idea of pretrained language models. You will learn the reasoning task that makes zero-shot classification possible.2 min read
04Chapter 4: Turning classification into an entailment questionAssume you know basic Python, supervised text classification, and the general idea of a pretrained language model. You should also be able to install Python packages and read a model's output.2 min read
05Chapter 5: Running the zero-shot pipelineThis chapter assumes basic Python, familiarity with supervised text classification, and a general idea of pretrained language models. You should also have transformers and PyTorch installed:2 min read
06Chapter 6: Hypothesis templates and how they change scoresThis chapter assumes you know basic Python, supervised text classification, and the idea of a pretrained transformer. You should also be able to install and import packages such as transformers.2 min read
07Chapter 7: Single-label and multi-label scoringThis chapter assumes that you know basic Python, supervised text classification, and the idea of a pretrained language model. You will use the Hugging Face zero-shot-classification pipeline.2 min read
08Chapter 8: Choosing and wording candidate labelsAssume you know basic Python, supervised text classification, and the idea of a pretrained language model. This chapter focuses on a practical part of zero-shot classification: designing the candidate labels that an NLI model compares with your text.3 min read
09Chapter 9: Measuring accuracy and macro F1 on a labeled sampleAssume you know basic Python, understand supervised text classification, and can install Python packages. In this chapter, you will evaluate a zero-shot classifier against a small set of hand-labeled messages. Evaluation shows whether the classifier works for your task instead of only producing plau2 min read
10Chapter 10: Thresholds and abstaining on low-confidence predictionsAssume you know basic Python, supervised text classification, and how to call a Hugging Face transformer pipeline. This chapter focuses on deciding when a zero-shot classifier should refuse to assign a label.2 min read
11Chapter 11: Limitations: cost per label, ambiguity, domain shift and biasThis chapter assumes that you understand basic Python, supervised text classification, pretrained language models, and the Hugging Face zero-shot-classification pipeline. The pipeline is useful when labeled data is scarce, but its predictions are not automatically reliable. Its main limitations come3 min read
12Chapter 12: Alternative: embedding similarity with a bi-encoderAssume you know basic Python, supervised text classification, and the general idea of a pretrained language model. This chapter shows an alternative to NLI-based zero-shot classification. Instead of asking whether a text entails a hypothesis, you compare the meaning of the text with the meaning of e2 min read
13Chapter 13: Alternative: prompting a generative modelAssume you know basic Python, supervised text classification, and the general idea of a pretrained language model. This chapter treats a generative model as a classifier by asking it to produce a label instead of calculating an entailment score.2 min read
14Chapter 14: Choosing an approach and when to fine-tune insteadAssume you know basic Python, supervised text classification, pretrained language models, and package installation. The central choice is whether to use a pretrained model directly, compare embeddings, prompt a generative model, or train a task-specific classifier.3 min read