Skip to content

Classification Workflow

Show a classifier report with class labels and probabilities.

mountForm(container, {
transport: createJsonTransport({ endpoint: "/api/classify" }),
schema: {
fields: [{ id: "text", kind: "text", label: "Text", required: true }],
reports: [
{
id: "intent",
kind: "classifier",
label: "Intent",
labels: ["support", "sales", "other"],
details: true,
},
],
},
});

Response:

{
"reports": {
"intent": {
"label": "support",
"confidence": 0.88,
"probabilities": {
"support": 0.88,
"sales": 0.07,
"other": 0.05
}
}
}
}

Expected UI behavior: the report renders only after submit and can show details when the payload includes them.

Mistakes to avoid:

MistakeFix
Using display labels as backend keysUse stable report ids.
Hiding classifier details in the schemaSet details: true or omit it to use the default.

Next: Regression Workflow.