Foundation Models Text Classification API, REST: TextClassification.Classify
Written by
Updated at October 17, 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": "string"
}
],
"modelVersion": "string"
}
Response containing classifier predictions.
Field |
Description |
predictions[] |
Result of classification - a list of label-confidence pairs. |
modelVersion |
string Model version (changes with model releases). |
ClassificationLabel
A pair of text label and corresponding confidence used in classification problems.
Field |
Description |
label |
string A label with a class name. |
confidence |
string Confidence of item's belonging to a class. |