Natural language inference
Natural language inference (NLI), also called textual entailment, is the task of deciding how two texts relate. Given a premise and a hypothesis, an NLI model says whether the premise entails the hypothesis, contradicts it, or is neutral. “Every bodily part has a function” entails “the eye has a function”. It contradicts “the eye is useless”.
Zero-shot classification
NLI models can also classify text into labels they were never trained on. Each label is written out as a hypothesis, and the model measures how strongly the text entails it. To ask whether an argument rests on cause, for example, the hypothesis could be “the premise describes a cause of the conclusion”. The label with the strongest entailment wins.
Small NLI models exist. DeBERTa-v3-xsmall, for instance, is about 70 MB, and it runs well on a CPU.
In Quell
See also
- Cross-encoders — NLI models are a kind of cross-encoder.
- Periodic Table of Arguments — the levers that zero-shot classification would choose between.
External links
- Textual entailment — background on the task.
What links here: Cross-encoders, ONNX and ort