jevpromptfoochoicemirrors promptfoo classifier

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.

Run this example in the console 1 jev question · answered inside one request
how it works // frame by frame

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.

frame 1/4 · the state
state
outputI've waited three weeks and nobody has replied. This is unacceptable.
valuesneutral · frustrated · grateful · confused
question → jev

Classify `output` into exactly one of the labels in `values`.

options
frustrated
frustrated
93%
neutral
neutral
3%
confused
confused
3%
grateful
grateful
1%
frustrated→ score 1conf 93%
exactly what jev is asked

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.

labelchoice · one of n

Classify `output` into exactly one of the labels in `values`.

  1. neutralneutral
  2. frustratedfrustrated
  3. gratefulgrateful
  4. confusedconfused
when to use it

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`.
inputs and example

What to send

required fields
outputvalues
optional fields
inputexpectedcriteria
in suites
PromptfooEverything
result shape

score mapped from the chosen option, label = option key, confidence, a probability per option, passed by option.

POST /api/v1/evaluateopen in console
{
  "evaluators": [
    "classifier"
  ],
  "output": "I've waited three weeks and nobody has replied. This is unacceptable.",
  "values": [
    "neutral",
    "frustrated",
    "grateful",
    "confused"
  ],
  "expected": "frustrated"
}
expected

frustrated with high probability: pass.

rolling it up

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.

related evaluators
questions people ask
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.