All Products
Search
Document Center

Platform For AI:Use model services to implement data pre-labeling

Last Updated:Apr 07, 2024

iTAG of Platform for AI (PAI) supports pre-labeling by using model services. You can register an Elastic Algorithm Service (EAS) model service in iTAG and use the service to perform pre-labeling.

Prerequisites

An online model service is deployed in EAS or an online service that does not require authentication is prepared.

Limits

Only classification scenarios, such as image and text classification, are supported.

Procedure

  1. Go to the iTAG page.

    1. Log on to the PAI console.

    2. In the left-side navigation pane, click Workspaces. On the Workspaces page, click the name of the workspace that you want to manage.

    3. On the details page of the workspace, choose Data Preparation > iTAG to go to the iTAG page.

  2. In the upper-right corner, click Go to Management Page to go to the iTAG platform.

  3. On the Service Marketplace tab, click the Model Service (Old) tab and then click Create Service.

  4. In the Configure step of the wizard, configure the parameters. The following table describes the parameters.

    Parameter

    Description

    Service Name

    The name of the service. The name can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter or a digit.

    Service Type

    The service type. Only HTTP is supported.

    Service Source

    The source of the service. Valid values: PAI and Others.

    • PAI: model services deployed in EAS. If you select this source, you must configure the Service Endpoint, Authentication Token, and Capability Type parameters.

    • Others: endpoints of other services that are accessible over the Internet. Encryption services that require authentication are not supported.

    Request Method

    Valid values: GET and POST. Select POST for EAS services.

    Parameter Submission Method

    Valid values: Submit JSON File and Submit Form. Select Submit JSON File for EAS services.

    Service Input Parameter Settings

    The input parameter settings of the service. In this example, the general text classification model is used. For more information, see NLP models.

    Input parameters:

    {
        "id": "the ID of the text",
        "first_sequence": "the text string to be classified",
        "sequence_length": 128
    }
    • Variable parameters:

      • Parameter 1: the input parameter that you want to identify. In this example, first_sequence is used.

      • Alias: the custom value that is used to match subsequent labeling tasks. Example: content.

      • Type: String and raw types are supported. In this example, String is used.

      • Default value: the default value that you want to use for identification. This parameter is optional.

    • Fixed parameters:

      • Parameter 1: a fixed input parameter. In this example, id is used.

      • Value: the fixed value for the parameter. In this example, 110 is used.

      • Parameter 2: another fixed input parameter. In this example, sequence_length is used.

      • Value: the fixed value for the parameter. In this example, 128 is used.

    Service Output Parameter Configuration

    Output parameters:

    {
        "id": "110", 
        "output": [
             {"pred": "World", "prob": 0.99915063, "logit": 10.21936}, 
             {"pred": "Health", "prob": 8.557205e-05, "logit": 0.8540586}, 
             {"pred": "Finance & Economics", "prob": 8.2030325e-05, "logit": 0.81178904}, 
             {"pred": "Technology", "prob": 8.076288e-05, "logit": 0.79621744}, 
             {"pred": "Sports", "prob": 7.966044e-05, "logit": 0.7824724},
             ......
        ]
    }
    • Parameter 1: the description of the output parameter. In this example, result is used.

    • Value path: the value path of the output parameter. In this example, $.result.output[0].pred is used.

  5. Click Next to go to the Debug step.

  6. Specify the input parameter value and click Request Service to start debugging.image

  7. Click Create to save the created model service.

  8. On the EAS-Online Model Services page, you can debug, delete, or edit the created model service.

Next steps

After you create and debug the model service, you can select Online Service Prediction when you create a labeling job to implement intelligent labeling. For more information, see Configure intelligent pre-labeling in iTAG.