Classification Spec
A classification: one choice question that picks a category for some text. It is a decision spec with exactly one question, so a decision service can answer it and a decision response holds its result under question.
ClassificationSpec departments = ClassificationSpec.builder()
.asking("Which team should handle this?")
.category("billing", "Payments, invoicing, refunds")
.category("technical", "Bugs, outages, integrations")
.build();Content copied to clipboard
It equals any decision spec that holds the same single question, and its JSON is the decision spec JSON.
Types
Link copied to clipboard
Collects the instructions and categories of a classification spec. Get one from ClassificationSpec.builder. A builder is not safe for use from several threads at once.
Properties
Functions
Link copied to clipboard
fun selected(categoryId: String, provenance: ModelProvenance, confidence: Double? = null): ClassificationResult.Selected
Returns a selection of one of this spec's categories.
Link copied to clipboard
Checks that a result fits this spec. A selection must name one of the categories. Other outcomes always fit.