Classifier models based on YandexGPT
Yandex AI Studio features classifier models powered by YandexGPT Lite and YandexGPT Pro to classify text requests provided in prompts. The classification is implemented based on the AI StudioText Classification API.
If an out-of-the-box model is not enough, you can fine-tune a YandexGPT Lite-based classifier for the model to classify your requests more accurately. To access a fine-tuned classifier model, use the classify Text Classification API method.
| Model | URI | Operating modes |
|---|---|---|
| Prompt-based classifier based on YandexGPT Lite | cls://<folder_ID>/yandexgpt-lite/latest |
Synchronous |
| Prompt-based classifier based on YandexGPT Pro | cls://<folder_ID>/yandexgpt/latest |
Synchronous |
| Fine-tuned classifier | cls://<basic_model_URI>/<version>@<tuning_suffix> |
Synchronous |
Accessing models
You can access classifier models in a number of ways.
When operating classifier models via Yandex Cloud ML SDK, use one of the following formats:
-
Model name, provided as a string.
model = ( sdk.models.text_classifiers("yandexgpt-lite") ) -
Model name and version, provided as strings in the
model_nameandmodel_versionfields, respectively.model = ( sdk.models.text_classifiers(model_name="yandexgpt", model_version="latest") ) -
Model URI, provided as a string containing the full URI of the model. You can also use this method to access fine-tuned models.
model = ( sdk.models.text_classifiers("cls://b1gt6g8ht345********/yandexgpt/latest") )
To access a model via the REST API or gRPC API, specify the model's URI containing the folder ID in the modelUri field of the request body. The /latest segment indicates the model version and is optional. To access a YandexGPT-based classifier model, use the fewShotClassify Text Classification API method/call.
Example:
{
"modelUri": "cls://b1gt6g8ht345********/yandexgpt-lite/latest"
...
}
To access the Latest version, you do not need to specify the model version explicitly because Latest is used by default.