Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • 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
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex AI Studio
    • About Yandex AI Studio
    • Yandex Workflows
    • Quotas and limits
    • Terms and definitions
  • Compatibility with OpenAI
  • Access management
  • Pricing policy
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • class yandex_cloud_ml_sdk._models.text_classifiers.function.TextClassifiers
  • class yandex_cloud_ml_sdk._models.text_classifiers.model.TextClassifiersModel

Domain

Written by
Yandex Cloud
Updated at August 25, 2025
  • class yandex_cloud_ml_sdk._models.text_classifiers.function.TextClassifiers
  • class yandex_cloud_ml_sdk._models.text_classifiers.model.TextClassifiersModel

class yandexcloudmlsdk.models.textclassifiers.function.TextClassifiersclass yandex_cloud_ml_sdk._models.text_classifiers.function.TextClassifiers

A class for text classifiers.

It provides a common interface for text classification models and constructs the model URI based on the provided model name and version.

__call__(model_name, *, model_version='latest')

Call the text classification model.

Constructs the URI for the model based on the provided model’s name and version. If the name contains ://, it is treated as a complete URI. Otherwise, it looks up the model name in the well-known names dictionary. But after this, in any case, we construct a URI in the form cls://<folder_id>//.

Parameters

  • model_name (str) – the name or URI of the model to call.
  • model_version (str) – the version of the model to be used. Defaults to ‘latest’.

Model

class yandexcloudmlsdk.models.textclassifiers.model.TextClassifiersModelclass yandex_cloud_ml_sdk._models.text_classifiers.model.TextClassifiersModel

A class for text classifiers models. It provides the foundational structure for building text classification models, including configuration and execution of classification tasks.

run(text, *, timeout=60)

Execute the text classification on the provided input text.

If only labels are specified, apply a zero-shot classifier. If samples are also specified - it is a case of the few-shot classifier. If nothing is specified, use the classify method, but it is only available for pre-trained models.

Read more about the classifiers in the documentation.

Parameters

  • text (str) – the input text to classify.
  • timeout (float) – the timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 60 seconds.

Return type

TextClassifiersModelResultBase

tune_deferred(train_datasets, *, classification_type, validation_datasets=Undefined, name=Undefined, description=Undefined, labels=Undefined, seed=Undefined, lr=Undefined, n_samples=Undefined, additional_arguments=Undefined, tuning_type=Undefined, scheduler=Undefined, optimizer=Undefined, timeout=60)

Initiate a deferred tuning process for the model.

Parameters

  • train_datasets (str | BaseDataset | tuple[str | BaseDataset, float] | Iterable[str | BaseDataset | tuple[str | BaseDataset, float]] | dict[str | BaseDataset, float]) – the dataset objects and/or dataset ids used for training of the model.
  • validation_datasets (str | BaseDataset | tuple[str | BaseDataset, float] | Iterable[str | BaseDataset | tuple[str | BaseDataset, float]] | dict[str | BaseDataset, float] | Undefined) – the dataset objects and/or dataset ids used for validation of the model.
  • classification_type (Literal['multilabel', 'multiclass', 'binary']) – the type of classification to perform during tuning (multilabel, multiclass, or binary).
  • name (str | Undefined) – the name of the tuning task.
  • description (str | Undefined) – the description of the tuning task.
  • labels (dict[str, str] | Undefined) – labels for the tuning task.
  • timeout (float) – the timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 60 seconds.
  • seed (int | Undefined) – a random seed for reproducibility.
  • lr (float | Undefined) – a learning rate for tuning.
  • n_samples (int | Undefined) – a number of samples for tuning.
  • additional_arguments (str | Undefined) – additional arguments for tuning.
  • tuning_type (BaseTuningType | Undefined) – a type of tuning to be applied.
  • scheduler (BaseScheduler | Undefined) – a scheduler for tuning.
  • optimizer (BaseOptimizer | Undefined) – an optimizer for tuning.

Return type

TuningTask[TextClassifiersModel]

tune(train_datasets, *, classification_type, validation_datasets=Undefined, name=Undefined, description=Undefined, labels=Undefined, seed=Undefined, lr=Undefined, n_samples=Undefined, additional_arguments=Undefined, tuning_type=Undefined, scheduler=Undefined, optimizer=Undefined, timeout=60, poll_timeout=259200, poll_interval=60)

Tune the model with the specified training datasets and parameters.

Parameters

  • train_datasets (str | BaseDataset | tuple[str | BaseDataset, float] | Iterable[str | BaseDataset | tuple[str | BaseDataset, float]] | dict[str | BaseDataset, float]) – the dataset objects and/or dataset ids used for training of the model.
  • validation_datasets (str | BaseDataset | tuple[str | BaseDataset, float] | Iterable[str | BaseDataset | tuple[str | BaseDataset, float]] | dict[str | BaseDataset, float] | Undefined) – the dataset objects and/or dataset ids used for validation of the model.
  • classification_type (Literal['multilabel', 'multiclass', 'binary']) – the type of classification to perform during tuning (multilabel, multiclass, or binary).
  • name (str | Undefined) – the name of the tuning task.
  • description (str | Undefined) – the description of the tuning task.
  • labels (dict[str, str] | Undefined) – labels for the tuning task.
  • timeout (float) – the timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 60 seconds.
  • seed (int | Undefined) – a random seed for reproducibility.
  • lr (float | Undefined) – a learning rate for tuning.
  • n_samples (int | Undefined) – a number of samples for tuning.
  • additional_arguments (str | Undefined) – additional arguments for tuning.
  • tuning_type (BaseTuningType | Undefined) – a type of tuning to be applied.
  • scheduler (BaseScheduler | Undefined) – a scheduler for tuning.
  • optimizer (BaseOptimizer | Undefined) – an optimizer for tuning.
  • poll_timeout (int) – the maximum time to wait while polling for completion of the tuning task. Defaults to 259200 seconds (72 hours).
  • poll_interval (float) – the interval between polling attempts during the tuning process. Defaults to 60 seconds.

Return type

Self

attach_tune_deferred(task_id, *, timeout=60)

Attach a deferred tuning task using its task ID.

Parameters

  • task_id (str) – the ID of the deferred tuning task to attach to.
  • timeout (float) – the timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 60 seconds.

Return type

TuningTask[TextClassifiersModel]

property config: ConfigTypeT

configure(*, task_description=Undefined, labels=Undefined, samples=Undefined)

Parameters

  • task_description (str | Undefined)
  • labels (Sequence[str] | Undefined)
  • samples (Sequence[TextClassificationSample] | Undefined)

Return type

Self

property uri: str

Was the article helpful?

© 2025 Direct Cursus Technology L.L.C.