Updated on 2026-11-06 GMT+08:00

Creating a Custom Operator

ModelArts data refinement provides built-in operators that cover common data processing scenarios. If the built-in operators cannot meet your data processing requirements, you can develop custom operators based on the ModelArts data refinement SDK and create and manage operators on the console. This section describes how to create a custom operator in ModelArts.

Prerequisites

You have developed a custom operator. For details, see Developing a Custom Operator.

Billing

Fees incurred by using custom operators are included in the ModelArts data refinement billing and are not billed separately. For details, see Data Management.

Procedure

  1. Log in to the ModelArts console. In the navigation pane on the left, choose Data Preparation > Data Refining.
  2. In the upper right corner of the Smart Refining page, click Refining Configuration.

  3. Click the Custom tab and click Create in the upper right corner of the page.
  4. On the Create Operator page, configure the required information and click Create Now.
    Table 1 Parameters for creating an operator

    Parameter

    Description

    Example Value

    Basic Info

    Name

    The name must start and end with a letter, and can only contain letters, digits, hyphens (-), and underscores (_). Length: 2 to 128 characters.

    DATA-FILTERING

    Version

    Defaults to V1. This version is updated synchronously when the operator is updated.

    V1

    Operator Type

    Quickly locate data refining operators by function.

    • Data Transformation: Applies deterministic format or structural changes on existing fields (e.g., type conversion, encoding normalization, data masking) without introducing new semantic information, ensuring that the information content remains unchanged before and after processing.
    • Data Filtering: Applies independent judgment to each record based on specific conditions, and removes entire records that do not meet the criteria. The judgment relies solely on the current record itself and does not depend on other records.
    • Data Labeling: Appends semantic labels, attributes, or scores (such as class labels, bounding boxes, and quality scores) to existing records without altering the original content. These labels serve to describe the data's identity and quality, facilitating model training or evaluation.

    Data Filtering

    Description

    Custom description of the operator. It can contain a maximum of 200 characters.

    -

    Operator Configuration

    Operator Execution Instance Flavor

    You can select CPU or NPU.

    CPU

    Input Dataset Type

    Ensure that the input dataset type of the operator is the same as the output dataset type, and that the format of the dataset of the corresponding dataset type in the operator package meets the platform requirements. This configuration item cannot be modified after being created.

    The input dataset type can be text, image, video, or other.

    IMAGE > Base Image

    GUI Parameters

    Operator parameter information. You can select Do not configure or Configure now.

    Click Configure now to configure the parameter name, interface display name, parameter type, constraint type, etc. On the right side of an operator parameter card, click Preview to view the parameter effect, or click Delete to remove the parameter.

    Below the operator parameter card, click Add UI Parameter to configure multiple parameters (up to 50 parameters supported). Click Preview to view all configured operator parameters.

    For parameters configured via Configure now, see Table 2.

    Operator Package Upload

    Source

    Upload the developed operator package (obtained from Prerequisites). You can select OBS or Local. Only one TAR file can be uploaded. Max file size: 4 GB. The file name in the TAR package can only contain English characters.

    • Storage type: You can choose Object Storage Service – Bucket or Object Storage Service – Parallel File System.
    • Storage address: Configure the current storage address of the data to be connected to this platform for subsequent data management and access. It must start with obs:// or /, must end with .tar, and must not contain // (except for the prefix).

    Local > Object Storage Service – Bucket > obs://dataset-test/DATA_FILTERING_IMAGE/ > local .tar package

    Table 2 Example parameter configuration

    Parameter Name (Key Value)

    Displayed Name

    Parameter Type

    Constraint Type

    Mandatory

    Default Value

    Description

    width_limit

    Minimum Width

    INT

    N/A

    No

    200

    Minimum width of the image (in pixels); images smaller than this value will be filtered out.

    height_limit

    Minimum Height

    INT

    N/A

    No

    200

    Minimum height of the image (in pixels); images smaller than this value will be filtered out.

    file_size_limit

    Minimum File Size

    INT

    N/A

    No

    5120

    Minimum file size of the image (in bytes); images smaller than this value will be filtered out.

    aspect_ratio_limit

    Maximum Aspect Ratio

    FLOAT

    N/A

    No

    3

    Maximum aspect ratio (width/height) of the image; images greater than this value will be filtered out.

  5. After creation, view the newly created operator card under the Custom tab.
    Figure 1 Custom operators

Follow-Up Operations

When creating a smart refinement task, you can add created custom operators. Operator names with indicate custom operators. For specific operations, see Creating a Smart Refining Task.

Figure 2 Adding a custom operator