Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex AI Studio
  • Getting started with Model Gallery
    • About Yandex AI Studio
    • Yandex Workflows
    • Quotas and limits
    • Terms and definitions
  • Switching from the AI Assistant API to Responses API
  • Compatibility with OpenAI
    • Overview
    • API authentication
        • Overview
          • Overview
          • Classify
          • FewShotClassify
  • Access management
  • Pricing policy
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • gRPC request
  • TextClassificationRequest
  • TextClassificationResponse
  • ClassificationLabel
  1. API references
  2. Text Classification API
  3. gRPC
  4. TextClassification
  5. Classify

Foundation Models Text Classification API, gRPC: TextClassificationService.Classify

Written by
Yandex Cloud
Updated at April 24, 2025
  • gRPC request
  • TextClassificationRequest
  • TextClassificationResponse
  • ClassificationLabel

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.

gRPC requestgRPC request

rpc Classify (TextClassificationRequest) returns (TextClassificationResponse)

TextClassificationRequestTextClassificationRequest

{
  "model_uri": "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

model_uri

string

The URI of your tuned classifier model.

text

string

Text for classification.

TextClassificationResponseTextClassificationResponse

{
  "predictions": [
    {
      "label": "string",
      "confidence": "double"
    }
  ],
  "model_version": "string",
  "input_tokens": "int64"
}

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.

model_version

string

The model version changes with each new releases.

input_tokens

int64

Number of input tokens

ClassificationLabelClassificationLabel

A pair of text labels and their corresponding confidence values.

Field

Description

label

string

A class name label.

confidence

double

The probability of classifying text into a specific class.

Was the article helpful?

Previous
Overview
Next
FewShotClassify
© 2025 Direct Cursus Technology L.L.C.