Scores a String against a runtime-supplied set of candidate labels with an offline zero-shot NLI model, emitting the ranked labels as [Classification], the single best as Classification, or the raw per-label [Double] scores.
Typical backends
Classify text read from a file against custom labels and publish the result as JSON.
Classify transcribed speech and route on the predicted label through a conditional branch.
Caveats
- Hard constraintThe zero-shot NLI checkpoint is supplied offline through the model bundle slot (a config.json + safetensors + tokenizer snapshot, e.g. MoritzLaurer/deberta-v3-large-zeroshot-v2.0) and is loaded once at startup with no network access; the model is fixed by the bound bundle.
- State lifetime
device is read once at startup to place the model, while the label set and the scoring mode are re-read on every message. - AccuracyIn competitive mode the scores form a softmax over the labels; in independent mode each label is a separate sigmoid, so the same text can score high or low on several labels at once.
- I/O contractEmpty or whitespace-only input text, or an empty label set, yields the safe empty result without running the model, and an inference fault is logged and degraded to that same safe value, so every input still emits exactly one output and downstream consumers must handle the empty case.
- AccuracyLabels are scored as inference hypotheses about the text, so phrasing each label as a clear, distinct category materially affects ranking quality.