Example-based classification
Provide 2-10 labeled example texts per class. The model generalises from the examples without any training step.
Classify text using a few labeled examples per class — no training step
You send a single `text` plus an `examples` map: each key is a class label, each value is a list of example strings for that class. The service embeds all examples, builds a per-class prototype, embeds the input, and returns the predicted label, a confidence value, and a label → score map of all classes. Synchronous. Note: the response field is `confidence`, not `score`. `all_scores` is an object (label → score), not an array of pairs.
Provide 2-10 labeled example texts per class. The model generalises from the examples without any training step.
Examples are embedded, averaged into class centroids, and the input is matched by similarity.
Returns the predicted label, a confidence value (0-1), and a label→score map for every class.
Backed by multilingual embeddings; examples and the input can be in any supported language.
Classify into domain-specific categories with 2-5 examples each (e.g. ticket intents, product types).
Recognise user intents with example utterances per intent.
Add or remove classes at any time by changing the examples map.
Input
text: string + examples: { label: [example1, example2, ...] }
Output
label, confidence, all_scores (label → score map)
Prerequisites
POST text + an examples map. The service embeds the examples, builds per-class prototypes, and classifies the input.
{
"text": "The pizza was delicious",
"examples": {
"food": ["Loved the pasta", "I enjoyed the burger"],
"hospitality": ["The hotel room was clean", "Great service at the bar"]
}
}Response
{
"status": "success",
"data": {
"label": "food",
"confidence": 0.8891,
"all_scores": {
"food": 0.8891,
"hospitality": 0.1109
}
}
}examples is a DICT { label: [text, ...] } — sending a list of {text, label} objects returns 400. Response field is `confidence` (not `score`).
Classify a text using a few labeled examples per class. Examples are embedded, prototypes built, input matched by similarity.
/v1/proxy/text-few-shot
Billed per request, independent of class count or example count.
| Service | Unit | Price |
|---|---|---|
| Few-Shot Classification | item | $0.006/request |
A: Yes — add another key to examples in the next request. There is no persisted classifier.
A: The model still picks one — check `confidence`. Treat low scores (e.g. < 0.5) as 'no confident match' in your application.
A: Supported — embeddings are multilingual. Mixed-language examples are fine.
1.2 (2026-04-29)
1.1 (2026-02-23)
1.0 (2026-01-26)