Few-Shot Classification
text-few-shotClassify text using a few labeled examples per class.
POST {text, examples} where examples is {label: [str, ...]}. The response is {label, confidence, all_scores}.
POST
/v1/proxy/text-few-shotFew-shot classification (sync)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
text | string | required | The text to classify. |
examples | object<string,array<string>> | required | Map of label → list of example strings. |
curl -X POST https://api.cn8.io/v1/proxy/text-few-shot \
-H "X-API-Key: <cn8_api_key>" \
-H "Content-Type: application/json" \
-d '{"text":"your text here","examples":{}}'Response
{
"status": "success",
"data": {
"label": "food",
"confidence": 0.8891,
"all_scores": { "food": 0.8891, "hospitality": 0.1109 }
}
}