Learn from a few examples
Give 2–10 example texts per class and the service generalizes from them — no training required.
Send a `text` plus an `examples` map — each key is a class label and each value is a
Learn more about Few-Shot ClassificationResults show up here
The sample input is ready — just hit Run.
Send a text plus an examples map — each key is a class label and each value is a short list of example texts for that class. The service compares your text against those examples and returns the predicted label, a confidence value, and an all_scores map of every class to its score. Responses are synchronous, and there's no training step — change the classes any time by editing the examples map.
Give 2–10 example texts per class and the service generalizes from them — no training required.
Get the predicted label, a confidence value from 0 to 1, and a score for every class.
Add or remove classes whenever you like by editing the examples map — nothing is stored between calls.
Examples and input can be in any supported language, and you can mix languages.
Custom taxonomy
Classify into domain-specific categories with a few examples each (e.g. ticket intents, product types).
Intent detection
Recognize user intents from a handful of example utterances per intent.
Evolving categories
Adjust your classes on the fly as your needs change.
input
text: a string to classify, plus examples: a map of { label: [example1, example2, ...] }.
output
The predicted label, a confidence value, and an all_scores map of every class to its score.
text and an examples map: each label points to a short list of example texts.data.label, its score as confidence, and every class's score in all_scores.examples as an object — {label: [text, text, ...]} — not a list of label/text objects.confidence — treat low values (for example below 0.5) as "no confident match" in your app.textrequiredstringThe text to classify.
examplesrequiredobject<string,array<string>>Map of label → list of example strings, e.g. {"food": ["...", "..."]}.
labelstringPredicted label.
confidencenumberConfidence of the predicted label, from 0 to 1. (The field is named confidence.)
all_scoresobject<string,number>Map of every label to its score. Sort by value to rank the classes.
Billed per request, regardless of how many classes or examples you send.
| Service | Unit | Price |
|---|---|---|
| Few-Shot Classification | item | $0.006/request |