内容审核 Moderation-文本内容审核(V2):请求示例

时间:2023-11-01 16:19:13

请求示例

识别文本内容是否有敏感内容,检测场景为广告,辱骂,涉黄,违禁品,灌水,检测文本为asdfasdfasdf。

“endpoint”即调用API的请求地址,不同服务不同区域的endpoint不同,具体请参见终端节点

例如,服务部署在“华北-北京四”区域的“endpoint”“moderation.cn-north-4.myhuaweicloud.com”,请求URL为“https://moderation.cn-north-4.myhuaweicloud.com/v2/{project_id}/moderation/text”“project_id”为项目ID,获取方法请参见获取项目ID

POST https://{endpoint}/v2/{project_id}/moderation/text{  "categories" : [ "ad",  "abuse", "porn", "contraband", "flood" ],  "items" : [ {    "text" :  "asdfasdfasdf",    "type" : "content"  } ]}
support.huaweicloud.com/api-moderation/moderation_03_0018.html