Loading tutorials
torch and transformers. You don't need to know t7 min readtorch and transformers installed. The previous chapter introduced natural language inference (NLI): given a premise and a hypothesis, a model dec6 min readtransformers and torch installed (pip install transformers torch). It also assumes you know the premise and hypothesis setup from the earlier chapters on natural language inference (NLI) and on turning classification into entailment. Here you will r6 min readzero-shot-classification pipeline from the previous chapter. It also assumes you know that an NLI model takes a premise and a hypothesis and predicts entailment, neutral, or contradiction. Here you will look at the one piece of the pipeline that you control bes6 min readzero-shot-classification pipeline from the previous chapter. It also assumes you know that the pipeline asks an NLI model whether a text entails a hypothesis built from each candidate label. Here you will learn what the multi_label argument changes in the mat6 min readzero-shot-classification pipeline and know that it scores each label by asking an NLI model whether the text entails a hypothesis built from that label. It also assumes you have seen the hypothesis_template argument. Here the focus is the label strings you pa6 min readzero-shot-classification pipeline and kn6 min readzero-shot-classification pipeline, that you know how hypothesis templates and multi_label=True work, and that you can compute accuracy and macro F1 on a small labeled sample. Zero-shot classification with an NLI model avoids labeling data, but it has four wea6 min readzero-shot-classification pipeline, you know what an NLI model does, and you can call a Python API. You do not need prior experience with prompt engineering.6 min read