Yandex Cloud
Поиск
Связаться с намиПодключиться
  • Истории успеха
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
    • Доступны в регионе
    • Инфраструктура и сеть
    • Платформа данных
    • Контейнеры
    • Инструменты разработчика
    • Бессерверные вычисления
    • Безопасность
    • Мониторинг и управление ресурсами
    • ИИ для бизнеса
    • Бизнес-инструменты
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Партнёрская программа
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Тарифы Yandex Cloud
    • Промоакции и free tier
    • Правила тарификации
  • Истории успеха
  • Документация
  • Блог
Проект Яндекса
© 2025 ТОО «Облачные Сервисы Казахстан»
Yandex AI Studio
  • Начало работы с Model Gallery
    • О сервисе Yandex AI Studio
    • Yandex Workflows
    • Квоты и лимиты
    • Термины и определения
  • Переход с AI Assistant API на Responses API
  • Совместимость с OpenAI
  • Управление доступом
  • Правила тарификации
  • Аудитные логи Audit Trails
  • Публичные материалы
  • История изменений

В этой статье:

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

Domain

Статья создана
Yandex Cloud
Обновлена 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

Была ли статья полезна?

Проект Яндекса
© 2025 ТОО «Облачные Сервисы Казахстан»