ClassificationResult

@ApiStatus.Experimental
sealed interface ClassificationResult

A provider assessment. No match, insufficient evidence, and operational failure are distinct.

In JSON a classification result is an object whose status member names its class: selected, no_match, inconclusive or failure.

Inheritors

Types

Link copied to clipboard

Assessment failed operationally; this is not a judgment about the input.

Link copied to clipboard

The provider could not reach a sufficiently supported judgment.

Link copied to clipboard
data class NoMatch constructor(val provenance: ModelProvenance) : ClassificationResult, MappedClassificationResult<Nothing>

A successful judgment that none of the requested categories matches.

Link copied to clipboard
class Selected constructor(val categoryId: String, val provenance: ModelProvenance, val confidence: Double? = null, distribution: List<CategoryProbability> = emptyList()) : ClassificationResult

A canonical category ID with the evidence the provider reported for it: an optional confidence and an optional distribution over the categories. Nothing is inferred. Confidence is finite and in 0,1, without a calibration guarantee. A distribution has unique category ids, sums to 1 within 1e-6 and includes the selected id. Direct construction cannot check membership in a spec; providers should use ClassificationSpec.selected, and consumers can validate against the spec, which also requires a distribution to cover exactly the spec's categories.