Identify data using a custom model

更新时间: 2026-07-17 18:32:44

DataWorks enables model training using the sample fields you provide. This process identifies content patterns in target fields and generates a rule model that you can use to discover data with similar patterns in your data assets.

Limitations

  • DataWorks does not support model training on sample fields with fewer than 10 rows of data, or on data shorter than 4 or longer than 40 characters. The minimum sample size is 10 rows and the maximum is 10,000 rows. If the total number of rows in the selected fields exceeds 10,000, the system randomly selects 10,000 rows for model training. If the total number is less than 10,000, all available rows are used for model training.

  • DataWorks currently supports model training only for data that contains numbers, English letters, and special characters. Model training is not supported for sample fields that contain Chinese characters, including Chinese punctuation.

Create a model

  1. Go to Data Security Guard.

    1. Log on to the DataWorks console. In the target region, click Data Governance > Security Center in the left-side navigation pane. On the page that appears, click Go to Security Center.

    2. In the left-side navigation pane, click Data Security > Sensitive Data Management and then click Try Now to access Data Security Guard.

      Note
      • If your Alibaba Cloud account is already authorized, you are directed to the Data Security Guard homepage.

      • If your Alibaba Cloud account is not authorized, you are redirected to the Data Security Guard authorization page. To use Data Security Guard features for the first time, go to Data Security > Sensitive Data Management, select Data Security Guard in the pop-up dialog, and then complete the authorization.

  2. In the left-side navigation pane, click Rule Setting > Sensitive Data Identification to go to the Sensitive data identification page.

  3. Create a model and start model training.

    1. On the Self-generated data identification models tab, click Create Model.

    2. In the Create Model dialog box, configure the Model Name and select training samples.

      • Positive sample field: Select one or more sample fields from a specific workspace for model training. DataWorks uses these fields to identify content patterns and generate a rule model for discovering data with similar patterns in your data assets.

        Note

        DataWorks does not support model training on sample fields with fewer than 10 rows of data, or on data shorter than 4 or longer than 40 characters. The minimum sample size is 10 rows and the maximum is 10,000 rows. If the total number of rows in the selected fields exceeds 10,000, the system randomly selects 10,000 rows for model training. If the total number is less than 10,000, all available rows are used for model training.

        DataWorks currently supports model training only for data that contains numbers, English letters, and special characters. Model training is not supported for sample fields that contain Chinese characters, including Chinese punctuation.

      • Negative sample field: To improve model accuracy, select negative sample fields. The system uses the data in these fields as negative samples for training. If you do not select a negative sample field, the system generates negative samples based on the patterns and volume of the positive samples.

    3. Click Next Step.

    4. Select I accept that Data Security Guard will use samples for model training, and then click Start Training.

      The system randomly extracts up to 100 rows of data from each selected sample field. The estimated training time is calculated based on the number of sample fields.

      Note

      Model training can take a long time. You can close the training dialog box and perform other operations while the training runs in the background.

  4. View the model training results.

    On the Self-generated data identification models page, view the training status and results of the target model to determine whether it is ready for deployment.

    • View the training status.

      • Remaining hh:mm:ss: The model is training.

      • Training Completed: The model has finished training.

      • Draft: The model is created but not yet trained and cannot be used for data identification.

    • View the training results.

      For a model with a Training Completed status, click the 编辑模型 icon in the Actions column to view how accurately the model's extracted features identify sample data. Deploy the model only when its accuracy reaches 100%.

      Note

      For best results, add more sample data and retrain the model until its accuracy is 100% before deployment.

      The evaluation page is divided into Positive sample and Negative sample sections, which show the hit rate, total samples, hits, and misses. The Identification details section displays the identification results (match or no match) for 10 random sample rows. You can click Refresh to view other random samples.

  5. Click Create to finish creating the rule model.

Next steps

After the rule model is created, go to the Data identification rules page to deploy the model. For more information, see Configure a data identification rule and run an identification task.

上一篇: Configure data detection rules and tasks 下一篇: Identify sensitive data with sample libraries
阿里云首页 大数据开发治理平台 DataWorks 相关技术圈