Moderation
The moderation connector is used to connect to the Huawei Cloud Content Moderation.
Content Moderation adopts image, text, and video moderation technologies that detect pornography, advertisements, and material related to terrorism. This reduces potential business risks.
Creating a Content Moderation Connection
- Log in to the new ROMA Connect console.
- In the navigation pane on the left, choose Connector. On the page displayed, click New Connection.
- Select the content moderation connector.
- In the dialog box displayed, configure the connector and click OK.
Parameter
Description
Name
Enter the connector instance name.
App Key
Access key ID (AK) of the current account. Obtain the AK by referring to Access Keys. If an AK/SK pair has been generated, find the downloaded AK/SK file (such as credentials.csv).
App Secret
Secret access key (SK) of the current account. Obtain the SK by referring to Access Keys. If an AK/SK pair has been generated, find the downloaded AK/SK file (such as credentials.csv).
Description
Enter the description of the connector to identify it.
Action
- Audio content moderation
- Task submission
- Job list query
- Result query
- Image moderation
- Text moderation
Configuration Parameters
Parameter |
Description |
---|---|
project_id |
Project ID, which is used for resource isolation. |
region_id |
Region ID. |
data |
This parameter and url are alternative. Base64 character string converted from the audio file. The size cannot exceed 4 MB. The audio duration cannot exceed 1 minute. |
url |
This parameter and data are alternative. URL of the audio file. Currently, URLs for temporarily authorized access and anonymously and publicly authorized access to audio files stored on OBS are supported. For details about how to set the OBS access permission, see Configuring the Access Permission of OBS. For security purposes, the current service cannot obtain data from any URL on the public network. |
config |
Audio file configuration. |
format |
Supported audio formats.
|
property |
Model feature string in use. Generally, the value is in the language_sampling rate_domain format. The sampling rate must be the same as that of the audio. The model feature string can be chinese_8k_common and chinese_16k_common. |
categories |
Supported categories:
|
Parameter |
Description |
---|---|
project_id |
Project ID, which is used for resource isolation. |
region_id |
Region ID. |
urls |
Image URL. Currently, the following URLs are supported:
You can configure a maximum of 500 URLs. The API response time depends on the image download time. If the image download takes a long time, the API call will fail. Ensure that the storage service where the image to be detected resides is stable and reliable. You are advised to use Huawei Cloud OBS. |
categories |
Detection scenarios.
You can set the parameter to the preceding values to check the corresponding elements. If this parameter is null or unavailable, politics and terrorism (excluding porn) are detected by default. |
moderation_rule |
Name of the moderation rule. The default rule is used by default. |
ad_categories |
Image and text moderation scenario. This parameter is valid only when the value of categories contains ad. The following scenarios are supported:
|
show_ocr_text |
Whether to return the OCR recognition result.
|
Parameter |
Description |
---|---|
project_id |
Project ID, which is used for resource isolation. |
region_id |
Region ID. |
status |
Job status. Possible values are as follows:
|
offset |
Offset. The default value is 0. |
limit |
Maximum number of records returned on each page. The default value is the number of jobs that meet the search criteria. |
Parameter |
Description |
---|---|
project_id |
Project ID, which is used for resource isolation. |
region_id |
Region ID. |
job_id |
Job ID. |
Parameter |
Description |
---|---|
project_id |
Project ID, which is used for resource isolation. |
region_id |
Region ID. |
urls |
This parameter and image are alternative. Image URL. Currently, the following URLs are supported:
The API response time depends on the image download time. If the image download takes a long time, the API call will fail. Ensure that the storage service where the image to be detected resides is stable and reliable. You are advised to use Huawei Cloud OBS. |
image |
This parameter and url are alternative. Indicates the Base64 character string converted from the image. The size cannot exceed 10 MB. The face of a political figure must contain at least 50 × 50 pixels. JPEG, PNG, BMP, WEBP, and GIF formats are supported. |
moderation_rule |
Name of the moderation rule. The default rule is used by default. |
categories |
Detection scenarios.
You can set the parameter to the preceding values to check the corresponding elements. If this parameter is left blank or does not exist, both politics and terrorism scenarios are checked, but the porn scenario is not included. The number of detection times in each scenario is calculated by category. |
ad_categories |
Image and text moderation scenario. This parameter is valid only when the value of categories contains ad. The following scenarios are supported:
|
threshold |
|
show_ocr_text |
Whether to return the OCR recognition result.
|
Parameter |
Description |
---|---|
project_id |
Project ID, which is used for resource isolation. |
region_id |
Region ID. |
categories |
Detection scenarios. The following scenarios are supported:
|
white_glossaries |
Whitelist that is enabled. The rules for using whitelists are as follows:
|
items |
Text items to be checked. Currently, only one item can be checked each time. |
text |
Text to be detected. The text is encoded using UTF-8. A maximum of 5,000 characters are allowed. If the text contains more than 5,000 characters, only the first 5,000 characters are detected. |
type |
Text type. The default value is content. Currently, only this value is supported. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot