Updated on 2024-04-01 GMT+08:00

Training a Model

After labeling the data, train a model. You can perform model training to obtain the required text classification model. The text used for training has at least two classifications (that is, more than two labels), and the number of texts in each classification is more than 20. Before training, ensure that the labeled text meets the requirements. Otherwise, the Train button is unavailable.

Procedure

  1. On the ExeML page, click the name of the project that is successfully created. The Label Data tab page is displayed.
    Figure 1 Finding unlabeled files
  2. On the Label Data tab page, click Train in the upper right corner. In the displayed Training Configuration dialog box, set related parameters. Table 1 describes the parameters.
    Figure 2 Setting training parameters
    Table 1 Parameter description

    Parameter

    Description

    Default Value

    Dataset Version

    This version is the one when the dataset is published in Data Management. In an ExeML project, when a training job is started, the dataset is published as a version based on the previous data labeling.

    The system automatically provides a version number. You can change it to the version number that you want.

    Randomly provided by the system

    Training and Validation Ratios

    The labeled sample is randomly divided into a training set and a validation set. By default, the training set ratio is 0.8. The "usage" field in manifest records the set type. The value ranges from 0 to 1.

    0.8

    Max. Training Duration (Minute)

    If the training is not completed within the maximum training duration, the training is forcibly stopped. You are advised to enter a larger value to prevent forcible stop during training. The value ranges from 6 to 6000. Properly extend the training duration. Set the training duration to more than 120 minutes for a training set with 500 pairs of text.

    60

    Training Preference

    • performance_first: performance first. The training duration is short and the generated model is small.
    • balance: balanced performance and precision
    • accuracy_first: precision first. The training duration is long and the generated model is large.

    balance

    Instance Flavor

    Select the resource specifications used for training. By default, the following specifications are supported:

    • Compute-intensive 1 instance (GPU): This flavor is billed on a pay-per-use basis.
    • Free (GPU): This flavor is free. However, if the flavor is used, the training job automatically stops after one hour. That is, the training job lasts for only one hour at a time. You are advised to evaluate the data size and ensure that the time of a training job does not exceed 1 hour. When there are a large number of users, they need to wait in a queue for this flavor.

    To use the free flavor, read the message carefully and select I have read and agree to the above.

    ExeML (GPU)Compute-intensive 2 instance (NPU)

  3. After configuring training parameters, click Next to go to the configuration page, confirm the specifications, and click Submit to start auto model training. The training takes a certain period of time. Wait until the training is complete. If you close or exit this page, the system still performs the training operation.
  4. On the Train Model tab page, wait until the training status changes from Running to Completed.
  5. View the training details, such as Accuracy, Evaluation Result, Training Parameters, and Classification Statistics. For details about the evaluation result parameters, see Table 2.
    Figure 3 Training details
    Table 2 Evaluation result parameters

    Parameter

    Description

    Recall

    Fraction of correctly predicted samples over all samples predicted as a class. It shows the ability of a model to distinguish positive samples.

    Precision

    Fraction of correctly predicted samples over all samples predicted as a class. It shows the ability of a model to distinguish negative samples.

    Accuracy

    Fraction of correctly predicted samples over all samples. It shows the general ability of a model to recognize samples.

    F1 Score

    Harmonic average of the precision and recall of a model. It is used to evaluate the quality of a model. A high F1 score indicates a good model.

An ExeML project supports multiple rounds of training, and each round generates a version. For example, the first training version is V001 (xxx), and the next version is V002 (xxx). The trained models can be managed by training version. After the trained model meets your requirements, deploy the model as a service.