结合行为、内容,采用多维度、多模型、多检测手段,识别文本中的垃圾内容,规避色情、广告、灌水、渉政、辱骂等内容风险。 注意:如果返回结果里面的results为空,也代表指定类型检测通过。
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
tasks | Task [] | 可选 |
|
指定检测对象,JSON数组中的每个元素是一个文件检测任务结构体(Task表)。最多支持10个元素,即对10张文本进行检测。每个元素的具体结构描述见Task。 | |||||||
|
|||||||||||
labels | Label [] | 可选 |
|
指定文本检测的应用场景,可选值包括: spam:含垃圾信息 politics: 涉政 abuse:辱骂 porn:智能鉴黄 terrorism:暴恐识别 flood:灌水 contraband:违禁 ad:文案违规识别 说明 支持多场景(Labels)一起检测,对一张文本同时进行鉴黄和暴恐识别,计费时也将按照两个场景计费。 | |||||||
|
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
taobao_request_id | String | 83FFDEFE-F863-4490-8C8F-165CFFC1954F | 请求ID |
data | Data | {} | 系统自动生成 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); AliyunViapiImageauditScantextRequest req = new AliyunViapiImageauditScantextRequest(); List<AliyunViapiImageauditScantextRequest.Task> list2 = new ArrayList<AliyunViapiImageauditScantextRequest.Task>(); AliyunViapiImageauditScantextRequest.Task obj3 = new AliyunViapiImageauditScantextRequest.Task(); list2.add(obj3); obj3.setContent( "某某某是傻逼" ); req.setTasks(list2); List<AliyunViapiImageauditScantextRequest.Label> list5 = new ArrayList<AliyunViapiImageauditScantextRequest.Label>(); AliyunViapiImageauditScantextRequest.Label obj6 = new AliyunViapiImageauditScantextRequest.Label(); list5.add(obj6); obj6.setLabel( "abuse" ); req.setLabels(list5); AliyunViapiImageauditScantextResponse rsp = client.execute(req); System.out.println(rsp.getBody()); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | < aliyun_viapi_imageaudit_scantext_response > < taobao_request_id >83FFDEFE-F863-4490-8C8F-165CFFC1954F</ taobao_request_id > < data > < elements > < element > < task_id >txt1CfztqP4bXt4c1YTRcLMyN-1sIrEq</ task_id > < results > < result > < suggestion >block</ suggestion > < details > < detail > < label >abuse</ label > < contexts > < context > < context >是傻逼</ context > </ context > </ contexts > </ detail > </ details > < rate >99.91</ rate > < label >abuse</ label > </ result > </ results > </ element > </ elements > </ data > </ aliyun_viapi_imageaudit_scantext_response > |
1 2 3 4 5 6 | < error_response > < code >50</ code > < msg >Remote service error</ msg > < sub_code >isv.invalid-parameter</ sub_code > < sub_msg >非法参数</ sub_msg > </ error_response > |
错误码 | 错误描述 | 解决方案 |
---|