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",
          "inputTokens": "string"
        }
        

Response with classifier predictions.

Field

Description

predictions[]

ClassificationLabel

The classification results with the `confidence`` values
for the probability of classifying the request text into each class.

modelVersion

string

The model version changes with each new releases.

inputTokens

string (int64)

Number of input tokens

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.