Send Training Request

Prev Next

Once the availability of the dependency modules is successfully verified, model training process can be initiated. For each training, unique modelId parameter must be assigned, and training data must be sent in JSON format.

  • Effective from v1.70, new training requests with the same modelId while a model training is already in progress will return the error message: "The training is still in progress for the same model ID: modelId"
  • Effective from v1.69, modelId parameter can only contain lowercase letters (a-z), numbers (0-9), and hyphens ("-"). Hyphens ("-") are not allowed at the beginning and end of the text.
  • Using a different modelId while retraining a model will lead to a change in the endpoint used for inference.
  • Please ensure that the modelId does not include any Turkish characters and does not exceed 63 characters.


Endpoint:

Deprecation Notice

The following URL for sending training request will be deprecated starting January 1, 2025:

{{baseUrl}}/sestekai-api/api/app/external-trainings/train

Please use the external URL for sending training request provided below.


URL: {{baseUrl}}/sestekai-api/api/external/trainings/train
HTTP Method: POST
Content-Type: multipart/form-data


The access token acquired for the training must be included in the request header.


Text Classification Training

Here's an example of a request:

curl --location ' {{baseUrl}}/sestekai-api/api/external/trainings/train' \
--header 'Authorization: Bearer <token>' \
--form 'modelId="\"unique id of the model\""' \
--form 'productName="<productName>"' \
--form 'languageCode="\"en-US\" | \"tr-TR\" | \"ar-SA\" | \"lv-LV\" | \"ru-RU\" | \"es-ES\" | “ur-PK\" | \"fr-FR\" | \"nl-NL\" | “de-DE\" | \"it-IT\"
"' \
--form 'dataSchema="utterance"' \
--form 'dataFile=@"/path/to/file"'

Expected Response: 200 OK & Response Body: Experiment Object


Sample Training File for Text Classification

text-classification-training-data.json

The JSON data file should have columns labeled as "Label" and "Text".

JSON Data Structure Sample:

{"Label": "label1", "Text": "text for the first entry."}
{"Label": "label2", "Text": "text for the second entry."}
{"Label": "label3", "Text": "text for the third entry."}