Zero-shot text classification
Classify a text into a set of labels you supply — intent, topic, category, routing queue, sentiment buckets, anything — without training data. Returns label (the best match, always one of your labels), labels (single-label: just the best match; multi-label: every label whose score >= threshold, possibly empty), scores (one {label, score} per input label, descending; a distribution in single-label mode, independent 0-1 applicability in multi-label mode) and a one-sentence rationale. Labels can be plain names or {name, description} objects — a short description per label sharpens borderline decisions. Use context to say what the texts are (e.g. "support tickets for a billing product"). 2-20 labels.
Request
- Base URL: https://api.sapling.ai
- URL: https://api.sapling.ai/api/v1/classify
- Auth: one of:
- HTTP bearer
- OAuth 2 (authorization code, authorization URL https://api.sapling.ai/oauth/authorize, token URL https://api.sapling.ai/oauth/token, scopes: sapling:api)
- none
Request body
Response
Successful response. Field-level schemas and examples: https://sapling.ai/docs/api/classify/ A batch (texts) request answers {"results": [...]} instead: one single-text response per input text, in input order.
Changes
No recorded changes to this operation across all 1 revision of this API.