Skip to content

Commit 74ee8b5

Browse files
nic12347franktguo
andauthored
CI-审核相关改动 (#308)
Co-authored-by: franktguo <franktguo@tencent.com>
1 parent 38857cd commit 74ee8b5

File tree

9 files changed

+263
-8
lines changed

9 files changed

+263
-8
lines changed

sample/detectAudio.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 若不传此参数,BizType为空时走默认策略,BizType不为空走定制化策略
3939
// 'Callback' => '', // 可选 回调URL
4040
// 'CallbackVersion' => '', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。
41+
// 'Freeze' => array(
42+
// 'PornScore' => 90,
43+
// 'AdsScore' => 90,
44+
// 'PoliticsScore' => 90,
45+
// 'TerrorismScore' => 90,
46+
// ), // 可选 可通过该字段,设置根据审核结果给出的不同分值,对音频文件进行自动冻结,仅当`input`中审核的音频为`object`时有效
4147
// ), // 可选 走默认策略及默认审核场景。
4248
));
4349
// 请求成功

sample/detectDocument.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,16 @@
3838
// 'BizType' => '',
3939
// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景
4040
// 'Callback' => '', // 回调URL 选填
41+
// 'Freeze' => array(
42+
// 'PornScore' => 90,
43+
// 'AdsScore' => 90,
44+
// 'PoliticsScore' => 90,
45+
// 'TerrorismScore' => 90,
46+
// ), // 选填 可通过该字段,设置根据审核结果给出的不同分值,对文档进行自动冻结。仅当`input`中审核的文档为`object`时有效。
4147
// ), // 选填 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
4248
));
49+
// 请求成功
50+
print_r($result);
4351

4452
// 文档URL审核
4553
$result = $cosClient->detectDocument(array(

sample/detectImages.php

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,73 @@
2727
// 'Interval' => '', // 可选 审核 GIF 时使用 截帧的间隔
2828
// 'MaxFrames' => '', // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。
2929
// 'DataId' => 'aaa', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节
30+
// 'LargeImageDetect' => 1, // 对于超过大小限制的图片是否进行压缩后再审核,取值为: 0(不压缩),1(压缩)。默认为0。注:压缩最大支持32M的图片,且会收取压缩费用
31+
// 'UserInfo' => array(
32+
// 'TokenId' => '',
33+
// 'Nickname' => '',
34+
// 'DeviceId' => '',
35+
// 'AppId' => '',
36+
// 'Room' => '',
37+
// 'IP' => '',
38+
// 'Type' => '',
39+
// 'ReceiveTokenId' => '',
40+
// 'Gender' => '',
41+
// 'Level' => '',
42+
// 'Role' => '',
43+
// ), // 可选 用户业务字段
44+
// 'Encryption' => array(
45+
// 'Algorithm' => '',
46+
// 'Key' => '',
47+
// 'IV' => '',
48+
// 'KeyId' => '',
49+
// 'KeyType' => 0,
50+
// ), // 可选 文件加密信息。如果图片未做加密则不需要使用该字段,如果设置了该字段,则会按设置的信息解密后再做审核。
3051
),
3152
array(
3253
'Url' => 'http://example.com/test.png', // 图片URL
3354
// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔
3455
// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。
3556
// 'DataId' => 'bbb', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节
57+
// 'LargeImageDetect' => 1, // 对于超过大小限制的图片是否进行压缩后再审核,取值为: 0(不压缩),1(压缩)。默认为0。注:压缩最大支持32M的图片,且会收取压缩费用
58+
// 'UserInfo' => array(
59+
// 'TokenId' => '',
60+
// 'Nickname' => '',
61+
// 'DeviceId' => '',
62+
// 'AppId' => '',
63+
// 'Room' => '',
64+
// 'IP' => '',
65+
// 'Type' => '',
66+
// 'ReceiveTokenId' => '',
67+
// 'Gender' => '',
68+
// 'Level' => '',
69+
// 'Role' => '',
70+
// ), // 可选 用户业务字段
71+
// 'Encryption' => array(
72+
// 'Algorithm' => '',
73+
// 'Key' => '',
74+
// 'IV' => '',
75+
// 'KeyId' => '',
76+
// 'KeyType' => 0,
77+
// ), // 可选 文件加密信息。如果图片未做加密则不需要使用该字段,如果设置了该字段,则会按设置的信息解密后再做审核。
3678
),
3779
// array(
38-
// 'Content' => $imgBase64Content, // 图片文件的内容,需要先经过 base64 编码。
80+
// 'Content' => $imgBase64Content, // 图片文件的内容,需要先经过 base64 编码。注:Content方式提交图片不支持文件加密方式
3981
//// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔
4082
//// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。
41-
//// 'DataId' => 'bbb', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节
83+
//// 'DataId' => 'ccc', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节
4284
// ),
4385
),
4486
// 'Conf' => array(
4587
// 'BizType' => '', // 可选 定制化策略,不传走默认策略
4688
// 'DetectType' => 'Porn,Ads', // 可选 不填走默认策略 或 定制化策略,四种参数:Porn,Ads等,可使用多种规则,注意规则间不要加空格
4789
// 'Async' => 0, // 可选 是否异步进行审核,0:同步返回结果,1:异步进行审核。默认值为 0。
4890
// 'Callback' => '', // 可选 审核结果(Detail版本)以回调形式发送至您的回调地址
91+
// 'Freeze' => array(
92+
// 'PornScore' => 90,
93+
// 'AdsScore' => 90,
94+
// 'PoliticsScore' => 90,
95+
// 'TerrorismScore' => 90,
96+
// ), // 可选 可通过该字段,设置根据审核结果给出的不同分值,对图片进行自动冻结,仅当`input`中审核的图片为`object`时有效。
4997
// ) // 可选 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
5098
));
5199
// 请求成功

sample/detectLiveVideo.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
// 'CallbackType' => 1,
3535
'BizType' => '07d41bbb5a3a93dca4xxxxxxxxxxx', // 直播流审核 BizType 必填,可联系工作人员生成后使用
3636
),
37+
'StorageConf' => array(
38+
'Path' => 'xxx',
39+
),
3740
));
3841
// 请求成功
3942
print_r($result);

sample/detectText.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@
4242
// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景
4343
// 'Callback' => '', // 回调URL 选填
4444
// 'CallbackVersion' => 'Detail', // 选填 Detail、Simple 默认为 Simple
45+
// 'Freeze' => array(
46+
// 'PornScore' => 90,
47+
// 'AdsScore' => 90,
48+
// 'IllegalScore' => 90,
49+
// 'AbuseScore' => 90,
50+
// 'PoliticsScore' => 90,
51+
// 'TerrorismScore' => 90,
52+
// ),
4553
// ), // 非必选,在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
4654
));
4755
// 请求成功

sample/detectVideo.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131
// 'Gender' => '',
3232
// 'Level' => '',
3333
// 'Role' => '',
34+
// ),
35+
// 'Encryption' => array(
36+
// 'Algorithm' => '',
37+
// 'Key' => '',
38+
// 'IV' => '',
39+
// 'KeyId' => '',
40+
// 'KeyType' => 0,
3441
// ),
3542
),
3643
'Conf' => array(
@@ -44,8 +51,16 @@
4451
// 'TimeInterval' => 50, // 可选 视频截帧频率
4552
'Count' => '3', // 视频截帧数量
4653
),
54+
// 'Freeze' => array(
55+
// 'PornScore' => 90,
56+
// 'AdsScore' => 90,
57+
// 'PoliticsScore' => 90,
58+
// 'TerrorismScore' => 90,
59+
// ), // 可选 自动冻结配置项,可配置指定审核分数的结果进行自动冻结
4760
),
4861
));
62+
// 请求成功
63+
print_r($result);
4964

5065
//视频url审核
5166
$videoUrl = 'http://example.com/test.mp4';
@@ -68,7 +83,6 @@
6883
),
6984
),
7085
));
71-
7286
// 请求成功
7387
print_r($result);
7488
} catch (\Exception $e) {

sample/detectWebpage.php

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,28 @@
1717
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
1818
'Input' => array(
1919
'Url' => 'https://www.xxx.com/',
20-
// 'DataId' => '' // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
20+
// 'DataId' => 'xxx', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
21+
// 'UserInfo' => array(
22+
// 'TokenId' => '',
23+
// 'Nickname' => '',
24+
// 'DeviceId' => '',
25+
// 'AppId' => '',
26+
// 'Room' => '',
27+
// 'IP' => '',
28+
// 'Type' => '',
29+
// 'ReceiveTokenId' => '',
30+
// 'Gender' => '',
31+
// 'Level' => '',
32+
// 'Role' => '',
33+
// ), // 可选 用户业务字段
2134
),
2235
// 'Conf' => array(
23-
//// 'DetectType' => 'Porn,Ads', // 可选 不填走默认策略
24-
//// 'ReturnHighlightHtml' => 'true', // 可选 'true' 或者 'false'
25-
//// 'Callback' => '', // 可选
26-
// ), // 可选 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
36+
// 'BizType' => 'd7a51676a0xxxxxxxxxxxxxxxxxxxxxx', // 可选 审核策略
37+
//// 'DetectType' => 'Porn', // 可选 审核的场景类型 注:该参数后续不再维护,请使用BizType参数
38+
// 'Callback' => 'http://xxx.com/xxx', // 可选 回调地址,以http://或者https://开头的地址。
39+
// 'ReturnHighlightHtml' => 'true', // 可选 true 或者 false 指定是否需要高亮展示网页内的违规文本,查询及回调结果时会根据此参数决定是否返回高亮展示的 html 内容
40+
// 'CallbackType' => 1, // 可选 回调片段类型,有效值:1(回调全部图片和文本片段)、2(回调违规图片和文本片段)。默认为 1。
41+
// ), // 审核规则配置
2742
));
2843
// 请求成功
2944
print_r($result);

0 commit comments

Comments
 (0)