Foundation Models Text Classification API, REST: TextClassification.classify
Written by
Updated at May 15, 2024
RPC method for text classification.
HTTP request
POST https://llm.api.cloud.yandex.net/foundationModels/v1/textClassification
Body parameters
{
"modelUri": "string",
"text": "string"
}
Request for the service to classify text.
Field | Description |
---|---|
modelUri | string The identifier of the classification model. |
text | string Text for classification. |
Response
HTTP Code: 200 - OK
{
"predictions": [
{
"label": "string",
"confidence": "number"
}
],
"modelVersion": "string"
}
Response containing classifier predictions.
Field | Description |
---|---|
predictions[] | object Result of classification - a list of label-confidence pairs. |
predictions[]. label |
string A label with a class name. |
predictions[]. confidence |
number (double) Confidence of item's belonging to a class. |
modelVersion | string Model version (changes with model releases). |