Help Center > > API Reference> Appendix> Configuring a Custom Dictionary

Configuring a Custom Dictionary

Updated at: Nov 13, 2019 GMT+08:00

Content Moderation can effectively identify the pornographic, political, or offensive content, advertisements, contraband, and spamming. You can configure whitelist and blacklist dictionaries for detection.

Background Information

  • To configure custom dictionaries, subscribe to Text Moderation first. For details about how to enable a service, see Applying for a Service.
  • You can custom dictionaries for free.
  • A maximum of 10 custom blacklist dictionaries and one custom whitelist dictionary can be created for an account.
  • The custom whitelist dictionary cannot be used in the flood scenario.

Creating a Custom Whitelist Dictionary

After subscribing to Text Moderation, you can configure a custom whitelist dictionary. When you use Text Moderation, the words in the custom whitelist dictionary may not be detected.

  1. Log in to HUAWEI CLOUD and click Console in the upper right corner. The Console page is displayed.
  2. Click Service List, and choose EI Enterprise Intelligence > Content Moderation. The Content Moderation management console is displayed.
  3. In the left navigation pane, choose Service List > Text Moderation. Click Configuration next to Custom Whitelist Dictionary. The Create Dictionary dialog box is displayed.
    Figure 1 Create Dictionary
  4. Enter a dictionary name and the keywords in the whitelist dictionary. Click OK.
    • Dictionary Name: A dictionary name contains a maximum of 40 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.
    • Add Keyword: A dictionary contains a maximum of 5,000 keywords. Each keyword consists of a maximum of 40 characters and ends with a carriage return.
    • The dictionary name cannot be modified.

Creating a Custom Blacklist Dictionary

After subscribing to Text Moderation, you can configure a custom blacklist dictionary. When you use Text Moderation, the words in the custom blacklist dictionary will be detected.

  1. Log in to HUAWEI CLOUD and click Console in the upper right corner. The Console page is displayed.
  2. Click Service List, and choose EI Enterprise Intelligence > Content Moderation. The Content Moderation management console is displayed.
  3. In the left navigation pane, choose Service List > Text Moderation. Click Configuration next to Custom Blacklist Dictionary. The Custom Dictionary page is displayed.
  4. Click Create Dictionary in the upper left corner. The Create Dictionary dialog box is displayed. Enter a dictionary name and the keywords in the blacklist dictionary.
    • Dictionary Name: A dictionary name contains a maximum of 40 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.
    • Add Keyword: A dictionary contains a maximum of 5,000 keywords. Each keyword consists of a maximum of 40 characters and ends with a carriage return.
  5. Click OK. After the dictionary is created, you can set it in the categories parameter.
    Figure 2 Configuring a custom dictionary
    Parameter Enabled when no scenario specified is optional and is not selected by default.
    • Selected: If categories is not specified, the default scenario and user-defined scenarios are supported.
    • Deselected: If categories is not specified, only the default scenario is supported.

    The dictionary name cannot be modified.

Modifying or Deleting a Custom Dictionary

Modifying or deleting a custom whitelist dictionary

  1. Log in to the Content Moderation management console.
  2. In the left navigation pane, choose Service List > Text Moderation. Click Configuration next to Custom Whitelist Dictionary. The Modify Dictionary dialog box is displayed.
    • Modify the target keywords and click OK.
    • Delete the target keywords or clear all keywords, and then click OK.

Modifying or deleting a custom blacklist dictionary

  1. Log in to the Content Moderation management console.
  2. In the left navigation pane, choose Service List > Text Moderation. Click Configuration next to Custom Blacklist Dictionary. The Custom Dictionary page is displayed.
    • Click Modify in the Operation column of the target dictionary. In the dialog box that is displayed, modify the keywords and click OK.
    • Click Delete in the Operation column of the target dictionary. In the dialog box that is displayed, click OK.

Deleted dictionaries cannot be recovered. Exercise caution when performing this operation.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel