Classifier
Classifier assigns the output one of the labels you pass in `values`, such as tones, intents or toxicity classes, with a probability per label. It mirrors promptfoo's `classifier` without a separate HuggingFace model; when `expected` names a label, the check passes on a match.
What the evaluator does
One Jev Choice over the labels, optionally guided by `criteria`. Score is the top label's probability; the full distribution is returned.
Classify `output` into exactly one of the labels in `values`.
The question, verbatim
This is the question the API sends for the example below, generated from the same code path the playground and API use. Jev sees the request fields as state and returns a probability for each outcome. Nothing is generated, so there is nothing to parse.
Classify `output` into exactly one of the labels in `values`.
- neutralneutral
- frustratedfrustrated
- gratefulgrateful
- confusedconfused
Reach for it when
- Tone, sentiment, intent or topic tagging with your own label set.
- Building confusion matrices for a routing model against gold labels.
Not the right tool when
- Labels are free text (use answer_similarity).
- Fixed moderation categories (moderation already has them).
Watch out for
- Overlapping labels split probability; keep the set mutually exclusive and describe edge cases in `criteria`.
What to send
score mapped from the chosen option, label = option key, confidence, a probability per option, passed by option.
{
"evaluators": [
"classifier"
],
"output": "I've waited three weeks and nobody has replied. This is unacceptable.",
"values": [
"neutral",
"frustrated",
"grateful",
"confused"
],
"expected": "frustrated"
}frustrated with high probability: pass.
Aggregate with
One result per item is a fact; a dataset of them is a metric. These are the aggregations that fit this evaluator's output shape.
Accuracy is the share of items the evaluator got right.
A confusion matrix counts, for a binary or multiclass check, how often each true label was predicted as each label: true positives, false positives, false negatives and true negatives.
Precision is the share of predicted positives that were really positive; recall is the share of real positives the evaluator caught; F1 is their harmonic mean, which is only high when both are.
Cohen's kappa measures agreement between two raters (an evaluator and a human, or two evaluators) after subtracting the agreement you would expect by chance.
- How is classifier different from classification?
- classification compares a predicted label string with an expected one in code. classifier asks Jev to assign the label from your list, so it works on raw text and returns a probability per label.