Foundation Models Text Classification API, REST: TextClassification.Classify
RPC method to classify text with tuned model.
The names of the classes between which the model will be distributing requests
must be specified during model tuning and are not provided in the request.
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 with tuned model.
The names of the classes between which the model will be distributing requests must be specified during model tuning;
therefore, they are not provided in the request.
For examples of usage, see step-by-step guides.
Field |
Description |
modelUri |
string The URI of your tuned classifier model. |
text |
string Text for classification. |
Response
HTTP Code: 200 - OK
{
"predictions": [
{
"label": "string",
"confidence": "string"
}
],
"modelVersion": "string"
}
Response with classifier predictions.
Field |
Description |
predictions[] |
The classification results with the `confidence`` values |
modelVersion |
string The model version changes with each new releases. |
ClassificationLabel
A pair of text labels and their corresponding confidence values.
Field |
Description |
label |
string A class name label. |
confidence |
string The probability of classifying text into a specific class. |