summaryrefslogtreecommitdiff
path: root/data/en_us/imageaudit/2019-12-30
diff options
context:
space:
mode:
Diffstat (limited to 'data/en_us/imageaudit/2019-12-30')
-rw-r--r--data/en_us/imageaudit/2019-12-30/api-docs.php827
1 files changed, 509 insertions, 318 deletions
diff --git a/data/en_us/imageaudit/2019-12-30/api-docs.php b/data/en_us/imageaudit/2019-12-30/api-docs.php
index 9c4d15f..756169b 100644
--- a/data/en_us/imageaudit/2019-12-30/api-docs.php
+++ b/data/en_us/imageaudit/2019-12-30/api-docs.php
@@ -1,19 +1,11 @@
<?php return [
'version' => '1.0',
- 'info' => [
- 'style' => 'RPC',
- 'product' => 'imageaudit',
- 'version' => '2019-12-30',
- ],
+ 'info' => ['style' => 'RPC', 'product' => 'imageaudit', 'version' => '2019-12-30'],
'directories' => [
[
- 'id' => 64301,
- 'title' => null,
+ 'children' => ['ScanImage', 'ScanText'],
'type' => 'directory',
- 'children' => [
- 'ScanImage',
- 'ScanText',
- ],
+ 'title' => 'Content moderation',
],
],
'components' => [
@@ -21,14 +13,9 @@
],
'apis' => [
'ScanImage' => [
- 'summary' => '图片审核接口',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'summary' => 'This topic describes the syntax and examples of the image content safety operation ScanImage.',
+ 'methods' => ['post'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -36,62 +23,42 @@
],
'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'none',
- 'riskType' => 'none',
- 'chargeType' => 'paid',
- ],
+ 'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'paid'],
'parameters' => [
[
'name' => 'Task',
'in' => 'formData',
'style' => 'repeatList',
'schema' => [
- 'description' => '1',
+ 'description' => '1.',
'type' => 'array',
'items' => [
'description' => '1',
'type' => 'object',
'properties' => [
- 'ImageTimeMillisecond' => [
- 'description' => '',
- 'type' => 'integer',
- 'format' => 'int64',
- 'required' => false,
- 'example' => '1',
- ],
- 'Interval' => [
- 'description' => '',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '1',
- ],
- 'ImageURL' => [
- 'description' => '',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'http://xxx.xxx.com/xxx.jpg',
- 'isFileTransferUrl' => true,
- ],
- 'MaxFrames' => [
- 'description' => '',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '1',
- ],
- 'DataId' => [
- 'description' => '',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'uuid-xxxx-xxxx-1234',
- ],
+ 'ImageTimeMillisecond' => ['description' => 'The creation or editing time of the image, in milliseconds.', 'type' => 'integer', 'format' => 'int64', 'required' => false, 'example' => '1', 'title' => ''],
+ 'Interval' => ['description' => 'The frame capture interval, used specifically for GIF or long image detection. A GIF image can be understood as an array of images, and one image is extracted for detection every **interval** images. Frames are captured from a GIF only when this parameter is specified. Long images support both long vertical images and long horizontal images.'."\n"
+ ."\n"
+ .'- Long vertical images (height greater than 400 pixels, height-to-width ratio greater than 2.5): the total number of images is calculated by rounding down `height/width`, and the image is split accordingly.'."\n"
+ ."\n"
+ .'- Long horizontal images (width greater than 400 pixels, width-to-height ratio greater than 2.5): the total number of images is calculated by rounding down `width/height`, and the image is split accordingly.'."\n"
+ ."\n"
+ .'> By default, only the first frame of a GIF or long image is detected. The interval parameter instructs the backend to skip frames at the specified interval during detection to reduce detection costs. Use this parameter together with the maxFrames parameter. For example, if you set interval to 2 and maxFrames to 100, every other frame is detected when detecting a long image or GIF, up to a maximum of 100 frames. Billing is based on the actual number of frames detected.', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '1', 'title' => ''],
+ 'ImageURL' => ['description' => 'The URL of the image to be detected. HTTP and HTTPS protocols are supported. We recommend that you use an OSS link in the China (Shanghai) region. If the file is stored locally or in an OSS link outside the China (Shanghai) region, see [File URL processing](~~155645~~).'."\n"
+ ."\n"
+ .'> If you use an OSS link in the China (Shanghai) region, the system automatically converts the OSS link to an internal network address before downloading the file, so calling this operation does not incur OSS traffic charges.', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://xxx.xxx.com/xxx.jpg', 'title' => ''],
+ 'MaxFrames' => ['description' => 'The maximum number of frames to capture, used specifically for GIF or long image detection. Default value: 1.'."\n"
+ .'When interval × maxFrames is less than the total number of images contained in the image, the frame capture interval is automatically adjusted to `total number of images / maxFrames` to improve overall detection accuracy.', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '1', 'title' => ''],
+ 'DataId' => ['description' => 'The data ID. All IDs must be unique within a single request.', 'type' => 'string', 'required' => false, 'example' => 'uuid-xxxx-xxxx-1234', 'title' => ''],
],
'required' => false,
+ 'title' => '',
+ 'example' => '',
],
'required' => true,
'maxItems' => 10,
+ 'title' => '',
+ 'example' => '',
],
],
[
@@ -99,17 +66,25 @@
'in' => 'formData',
'style' => 'repeatList',
'schema' => [
- 'description' => '1',
+ 'description' => '1.',
'type' => 'array',
- 'items' => [
- 'description' => '',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'porn',
- ],
+ 'items' => ['description' => 'The common scenarios for image detection. Valid values:'."\n"
+ ."\n"
+ .'- porn: image pornography detection'."\n"
+ ."\n"
+ .'- terrorism: image sensitive content recognition and image risky person recognition'."\n"
+ ."\n"
+ .'- ad: image spam advertisement recognition'."\n"
+ ."\n"
+ .'- live: image inappropriate scene recognition'."\n"
+ ."\n"
+ .'- logo: image logo recognition'."\n"
+ ."\n"
+ .'> Multiple scenes can be detected simultaneously. For example, `scenes=["porn", "terrorism"]` performs both pornography detection and terrorism-related content recognition on a single image. In this case, billing is calculated for two scenes.', 'type' => 'string', 'required' => false, 'example' => 'porn', 'title' => ''],
'required' => true,
'example' => 'porn',
'maxItems' => 6,
+ 'title' => '',
],
],
],
@@ -120,270 +95,280 @@
'description' => '1',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => '69B41AE8-1234-1234-1234-12D395695D2D',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => '69B41AE8-1234-1234-1234-12D395695D2D', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.',
'type' => 'object',
'properties' => [
'Results' => [
- 'description' => '',
+ 'description' => 'The image detection results.',
'type' => 'array',
'items' => [
'description' => '1',
'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'http://xxx.xxx.xxx/xxx.jpg',
- ],
- 'DataId' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'uuid-xxxx-xxx-1234',
- ],
+ 'ImageURL' => ['description' => 'The image URL.', 'type' => 'string', 'example' => 'http://xxx.xxx.xxx/xxx.jpg', 'title' => ''],
+ 'DataId' => ['description' => 'The data ID.', 'type' => 'string', 'example' => 'uuid-xxxx-xxx-1234', 'title' => ''],
'SubResults' => [
- 'description' => '',
+ 'description' => 'The detection results for a single image.',
'type' => 'array',
'items' => [
'description' => '1',
'type' => 'object',
'properties' => [
'SfaceDataList' => [
- 'description' => '',
+ 'description' => 'The terrorism-related sensitive information identified in the image when the image contains terrorism-related sensitive content.'."\n"
+ ."\n"
+ .'> This parameter applies only to the terrorism and sface scenes. For details about this parameter in the sface scene, see sensitive face detection.',
'type' => 'array',
'items' => [
'description' => '1',
'type' => 'object',
'properties' => [
- 'Width' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '97',
- ],
+ 'Width' => ['description' => 'The width of the face region.', 'type' => 'number', 'format' => 'float', 'example' => '97', 'title' => ''],
'Faces' => [
- 'description' => '',
+ 'description' => 'The identified face information.',
'type' => 'array',
'items' => [
'description' => '1',
'type' => 'object',
'properties' => [
- 'Name' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'abc',
- ],
- 'Id' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'AliFace_0001234',
- ],
- 'Rate' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '91.54',
- ],
+ 'Name' => ['description' => 'The name of the similar person.', 'type' => 'string', 'example' => 'abc', 'title' => ''],
+ 'Id' => ['description' => 'The face ID.', 'type' => 'string', 'example' => 'AliFace_0001234', 'title' => ''],
+ 'Rate' => ['description' => 'The similarity probability.', 'type' => 'number', 'format' => 'float', 'example' => '91.54', 'title' => ''],
],
+ 'title' => '',
+ 'example' => '',
],
+ 'title' => '',
+ 'example' => '',
],
- 'Height' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '131',
- ],
- 'Y' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '39',
- ],
- 'X' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '49',
- ],
+ 'Height' => ['description' => 'The height of the face region.', 'type' => 'number', 'format' => 'float', 'example' => '131', 'title' => ''],
+ 'Y' => ['description' => 'The distance from the upper-left corner of the face region to the x-axis, with the upper-left corner of the image as the origin.', 'type' => 'number', 'format' => 'float', 'example' => '39', 'title' => ''],
+ 'X' => ['description' => 'The distance from the upper-left corner of the face region to the y-axis, with the upper-left corner of the image as the origin.', 'type' => 'number', 'format' => 'float', 'example' => '49', 'title' => ''],
],
+ 'title' => '',
+ 'example' => '',
],
+ 'title' => '',
+ 'example' => '',
],
'HintWordsInfoList' => [
- 'description' => '',
+ 'description' => 'The risk keyword information matched by the advertisement text in the image when the image contains advertisements. The value is in array format.'."\n"
+ ."\n"
+ .'> This parameter applies only to the ad scene. Example: `"hintWordsInfo":[{"context":"sensitive word"}]`.',
'type' => 'array',
'items' => [
'description' => '1',
'type' => 'object',
'properties' => [
- 'Context' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'abc',
- ],
+ 'Context' => ['description' => 'The risk keyword content matched by the text in the image.', 'type' => 'string', 'example' => 'abc', 'title' => ''],
],
+ 'title' => '',
+ 'example' => '',
],
+ 'title' => '',
+ 'example' => '',
],
- 'Suggestion' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'block',
- ],
+ 'Suggestion' => ['description' => 'The recommended action.'."\n"
+ ."\n"
+ .'- pass: The image is normal and no further action is required, or no target object is identified.'."\n"
+ ."\n"
+ .'- review: The detection result is uncertain and manual review is required, or no target object is identified.'."\n"
+ ."\n"
+ .'- block: The image violates the rules. We recommend that you take further action, such as deleting the image or restricting access.', 'type' => 'string', 'example' => 'block', 'title' => ''],
'ProgramCodeDataList' => [
- 'description' => '',
+ 'description' => 'The location information of mini program codes when the image contains mini program codes.'."\n"
+ ."\n"
+ .'> This parameter applies only to the qrcode scene, and you must have enabled mini program code recognition by contacting us through the DingTalk group (23109592).',
'type' => 'array',
'items' => [
'description' => '1',
'type' => 'object',
'properties' => [
- 'Width' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '402.0',
- ],
- 'Height' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '413.0',
- ],
- 'Y' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '0.0',
- ],
- 'X' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '11.0',
- ],
+ 'Width' => ['description' => 'The width of the mini program code region.', 'type' => 'number', 'format' => 'float', 'example' => '402.0', 'title' => ''],
+ 'Height' => ['description' => 'The height of the mini program code region.', 'type' => 'number', 'format' => 'float', 'example' => '413.0', 'title' => ''],
+ 'Y' => ['description' => 'The distance from the upper-left corner of the mini program code region to the x-axis, with the upper-left corner of the image as the origin.', 'type' => 'number', 'format' => 'float', 'example' => '0.0', 'title' => ''],
+ 'X' => ['description' => 'The distance from the upper-left corner of the mini program code region to the y-axis, with the upper-left corner of the image as the origin.', 'type' => 'number', 'format' => 'float', 'example' => '11.0', 'title' => ''],
],
+ 'title' => '',
+ 'example' => '',
],
+ 'title' => '',
+ 'example' => '',
],
'OCRDataList' => [
'description' => '1',
'type' => 'array',
- 'items' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'abc',
- ],
+ 'items' => ['description' => 'The complete text information recognized in the image.', 'type' => 'string', 'example' => 'abc', 'title' => ''],
+ 'title' => '',
+ 'example' => '',
],
'Frames' => [
- 'description' => '',
+ 'description' => 'The temporary access addresses of each frame if the image is truncated because it is too long. You can use these addresses for reference.',
'type' => 'array',
'items' => [
'description' => '1',
'type' => 'object',
'properties' => [
- 'URL' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'http://xxx.xxx.com/xxx-0.jpg',
- ],
- 'Rate' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '89.85',
- ],
+ 'URL' => ['description' => 'The temporary access URL of the truncated image. The URL is valid for 5 minutes.', 'type' => 'string', 'example' => 'http://xxx.xxx.com/xxx-0.jpg', 'title' => ''],
+ 'Rate' => ['description' => 'The probability that the result belongs to this category. Valid values: 0 to 100. A higher value indicates a higher probability of belonging to this category.', 'type' => 'number', 'format' => 'float', 'example' => '89.85', 'title' => ''],
],
+ 'title' => '',
+ 'example' => '',
],
+ 'title' => '',
+ 'example' => '',
],
'LogoDataList' => [
- 'description' => '',
+ 'description' => 'The logo information identified in the image when the image contains logos.'."\n"
+ ."\n"
+ .'> This parameter applies only to the logo scene.',
'type' => 'array',
'items' => [
'description' => '1',
'type' => 'object',
'properties' => [
- 'Type' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'TV',
- ],
- 'Width' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '106',
- ],
- 'Height' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '106',
- ],
- 'Y' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '68',
- ],
- 'Name' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'abc',
- ],
- 'X' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '140',
- ],
+ 'Type' => ['description' => 'The type of the identified logo. The value is TV (channel logo).', 'type' => 'string', 'example' => 'TV', 'title' => ''],
+ 'Width' => ['description' => 'The width of the logo region.', 'type' => 'number', 'format' => 'float', 'example' => '106', 'title' => ''],
+ 'Height' => ['description' => 'The height of the logo region.', 'type' => 'number', 'format' => 'float', 'example' => '106', 'title' => ''],
+ 'Y' => ['description' => 'The distance from the upper-left corner of the logo region to the x-axis, with the upper-left corner of the image as the origin.', 'type' => 'number', 'format' => 'float', 'example' => '68', 'title' => ''],
+ 'Name' => ['description' => 'The name of the identified logo.', 'type' => 'string', 'example' => 'abc', 'title' => ''],
+ 'X' => ['description' => 'The distance from the upper-left corner of the logo region to the y-axis, with the upper-left corner of the image as the origin.', 'type' => 'number', 'format' => 'float', 'example' => '140', 'title' => ''],
],
+ 'title' => '',
+ 'example' => '',
],
+ 'title' => '',
+ 'example' => '',
],
- 'Label' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'normal',
- ],
- 'Scene' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'ad',
- ],
- 'Rate' => [
- 'description' => '',
- 'type' => 'number',
- 'format' => 'float',
- 'example' => '99.91',
- ],
+ 'Label' => ['description' => 'The category of the detection result, which corresponds to a specific scene. For valid values, see the mapping between scene and label.', 'type' => 'string', 'example' => 'normal', 'title' => ''],
+ 'Scene' => ['description' => 'The image detection scenario, which corresponds to the scenes specified in the request.', 'type' => 'string', 'example' => 'ad', 'title' => ''],
+ 'Rate' => ['description' => 'The probability that the result belongs to this category. Valid values: 0 to 100. A higher value indicates a higher probability of belonging to this category.', 'type' => 'number', 'format' => 'float', 'example' => '99.91', 'title' => ''],
],
+ 'title' => '',
+ 'example' => '',
],
+ 'title' => '',
+ 'example' => '',
],
- 'TaskId' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'img4wlJcb7p4wH4lAP3111111-123456',
- ],
+ 'TaskId' => ['description' => 'The task ID.', 'type' => 'string', 'example' => 'img4wlJcb7p4wH4lAP3111111-123456', 'title' => ''],
],
+ 'title' => '',
+ 'example' => '',
],
+ 'title' => '',
+ 'example' => '',
],
],
+ 'title' => '',
+ 'example' => '',
],
],
+ 'title' => '',
+ 'example' => '',
+ ],
+ ],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"69B41AE8-1234-1234-1234-12D395695D2D\\",\\n \\"Data\\": {\\n \\"Results\\": [\\n {\\n \\"ImageURL\\": \\"http://xxx.xxx.xxx/xxx.jpg\\",\\n \\"DataId\\": \\"uuid-xxxx-xxx-1234\\",\\n \\"SubResults\\": [\\n {\\n \\"SfaceDataList\\": [\\n {\\n \\"Width\\": 97,\\n \\"Faces\\": [\\n {\\n \\"Name\\": \\"abc\\",\\n \\"Id\\": \\"AliFace_0001234\\",\\n \\"Rate\\": 91.54\\n }\\n ],\\n \\"Height\\": 131,\\n \\"Y\\": 39,\\n \\"X\\": 49\\n }\\n ],\\n \\"HintWordsInfoList\\": [\\n {\\n \\"Context\\": \\"abc\\"\\n }\\n ],\\n \\"Suggestion\\": \\"block\\",\\n \\"ProgramCodeDataList\\": [\\n {\\n \\"Width\\": 402,\\n \\"Height\\": 413,\\n \\"Y\\": 0,\\n \\"X\\": 11\\n }\\n ],\\n \\"OCRDataList\\": [\\n \\"abc\\"\\n ],\\n \\"Frames\\": [\\n {\\n \\"URL\\": \\"http://xxx.xxx.com/xxx-0.jpg\\",\\n \\"Rate\\": 89.85\\n }\\n ],\\n \\"LogoDataList\\": [\\n {\\n \\"Type\\": \\"TV\\",\\n \\"Width\\": 106,\\n \\"Height\\": 106,\\n \\"Y\\": 68,\\n \\"Name\\": \\"abc\\",\\n \\"X\\": 140\\n }\\n ],\\n \\"Label\\": \\"normal\\",\\n \\"Scene\\": \\"ad\\",\\n \\"Rate\\": 99.91\\n }\\n ],\\n \\"TaskId\\": \\"img4wlJcb7p4wH4lAP3111111-123456\\"\\n }\\n ]\\n }\\n}","type":"json"}]',
+ 'title' => 'Image content safety',
+ 'description' => '## Feature description'."\n"
+ .'Image content safety combines behavioral and content analysis, using multi-dimensional models and detection methods to identify sensitive information in images and mitigate content risks such as sensitive individuals and sensitive events in images.'."\n"
+ .'Supported detection scenarios include: image pornography detection, image sensitive content recognition, image risky person recognition, image spam advertisement recognition, image inappropriate scene recognition, and image logo recognition.'."\n"
+ .'When you submit a detection task, specify the scenes parameter. You can combine multiple scenes to detect various risks in the same image.'."\n"
+ ."\n"
+ .'> - When you detect multiple scenes simultaneously, you are charged based on the number of images detected per scene multiplied by the unit price of each scene. The detection results contain the labels corresponding to the scenes you specified. You can determine the specific risk type based on the returned parameter values and then process the image accordingly.'."\n"
+ .'- You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) for online assistance.'."\n"
+ .'- For questions about API integration, usage, or consultation regarding Alibaba Cloud Vision Intelligence Open Platform visual AI capabilities, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n\n"
+ .'In image moderation, the mapping between scene and label is as follows: '."\n"
+ .'| scene | Description | label |'."\n"
+ .'| --------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |'."\n"
+ .'| porn | Image pornography detection: detects pornographic and vulgar content in images. | normal (normal image), sexy (sexy image), porn (pornographic image) |'."\n"
+ .'| terrorism | Image sensitive content recognition: detects sensitive events, violence, weapons, terrorism, gore, explosions, and other content in images.<br>Image risky person recognition: detects sensitive individuals and celebrities in images. | normal (normal image), bloody (gore), explosion (explosion and smoke), outfit (special attire), logo (special logo), weapon (weapon), politics (sensitive content), violence (fighting), crowd (crowd gathering), parade (parade), carcrash (car crash scene), flag (flag), location (landmark), drug (drug-related), gamble (gambling), others (other) |'."\n"
+ .'| ad | Image spam advertisement recognition: detects advertisement information in images, with particularly effective recognition of text-based advertisements similar to psoriasis ads. | normal (normal image), politics (text containing sensitive content), porn (text containing pornographic content), abuse (text containing abusive content), terrorism (text containing terrorism-related content), contraband (text containing prohibited content), spam (text containing other spam content), npx (psoriasis advertisement), qrcode (contains QR code), programCode (contains mini program code), ad (other advertisement) |'."\n"
+ .'| live | Image inappropriate scene recognition: detects drug-related, gambling, picture-in-picture, and other content in images. | normal (normal image), meaningless (meaningless image), PIP (picture-in-picture), smoking (smoking), drivelive (in-car live streaming), drug (drug-related), gamble (gambling) |'."\n"
+ .'| logo | Image logo recognition: detects channel logos, watermarks, trademarks, and other content in images. | normal (normal image), TV (image with regulated logo), trademark (trademark) |.'."\n"
+ ."\n"
+ .'## Integration guide'."\n"
+ .'1. Register an Alibaba Cloud account: Go to the [Alibaba Cloud website](https://www.aliyun.com), click **Sign Up** in the upper-right corner, and follow the instructions to complete account registration.'."\n"
+ .'2. Activate the service: Make sure you have activated the [Content Moderation service](https://vision.aliyun.com/imageaudit). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageaudit_public_cn#/open).'."\n"
+ .'3. Create an AccessKey: Make sure you have [created an AccessKey](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageaudit/2019-12-30/ScanImage?lang=JAVA) to debug the operation online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Content Moderation (imageaudit) AI category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the References as needed and invoke the operation.'."\n"
+ ."\n"
+ .'6. Sample code: For sample code in commonly used languages, see [Image content safety sample code](~~478892~~).'."\n"
+ ."\n"
+ .'7. Direct client calls: Common client call methods for this operation include the following.'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ ."\n"
+ .'- Image format: PNG, JPG, JPEG, BMP, GIF, and WEBP.'."\n"
+ .'- Image size: up to 9 MB.'."\n"
+ .'- Image resolution: We recommend a resolution greater than 256 × 256 pixels. Low resolution may affect recognition accuracy. For extra-long images, neither the width nor the height can exceed 30,000 pixels. The total pixel count (width × height) of a GIF image cannot exceed 4,194,304 pixels. Exceeding this value returns an InvalidFile.Download (file cannot be downloaded) error.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Detection notes'."\n"
+ ."\n"
+ .'- The maximum detection time is 6 seconds. If detection is not completed within this time, the system returns a timeout error code.'."\n"
+ ."\n"
+ .'- The image download time limit is 3 seconds. If the download time exceeds 3 seconds, a download timeout is returned.'."\n"
+ ."\n"
+ .'- The response time of the image detection operation depends on the image download time. Make sure the storage service hosting the images is stable and reliable. We recommend that you use Alibaba Cloud OSS or CDN caching.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For the billable methods and pricing of image content safety, see [Billing overview](~~202478~~).'."\n"
+ ."\n"
+ .'> The debugging operation below is a paid operation. To try it for free, go to the experience center. The corresponding experience entries are listed in the following table.'."\n"
+ ."\n\n"
+ .'| Capability | Experience center |'."\n"
+ .'| ---------------- | ------------------------------------------------------------ |'."\n"
+ .'| Image pornography detection | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=IdentifyPorn) |'."\n"
+ .'| Image sensitive content recognition | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=IdentifyTerrorism) |'."\n"
+ .'| Image logo recognition | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=IdentifyLogo) |'."\n"
+ .'| Image spam advertisement recognition | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=IdentifyAdvertisement) |'."\n"
+ .'| Image inappropriate scene recognition | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=IdentifyUnhealthyScene) |'."\n"
+ .'| Image risky person recognition | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=IdentifySensitiveFace) |.',
+ 'requestParamsDescription' => '> You can specify up to 10 detection objects, which means you can detect up to 10 images simultaneously.',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'For the image content safety capability under the Alibaba Cloud Vision AI Content Moderation category, we recommend using the SDK. Multiple programming languages are supported. When calling the operation, select the SDK package for the Content Moderation (imageaudit) AI category. File parameters support local files and arbitrary URLs through the SDK. For more information, see [SDK overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample code'."\n"
+ .'For sample code in commonly used languages, see [Image content safety sample code](~~478892~~).',
+ 'extraInfo' => '## Fault codes'."\n"
+ .'For fault codes of image content safety, see [Common fault codes](~~146773~~).'."\n"
+ ."\n"
+ .'## Playground'."\n"
+ .'For more open source free models to try and download, visit ModelScope: [Content Moderation Model - Pornography Detection](https://modelscope.cn/models/damo/cv_resnet50_image-classification_cc/summary).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Make sure the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging experience are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [],
+ 'ramActions' => [
+ [
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'viapi-imageaudit:ScanImage',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"69B41AE8-1234-1234-1234-12D395695D2D\\",\\n \\"Data\\": {\\n \\"Results\\": [\\n {\\n \\"ImageURL\\": \\"http://xxx.xxx.xxx/xxx.jpg\\",\\n \\"DataId\\": \\"uuid-xxxx-xxx-1234\\",\\n \\"SubResults\\": [\\n {\\n \\"SfaceDataList\\": [\\n {\\n \\"Width\\": 97,\\n \\"Faces\\": [\\n {\\n \\"Name\\": \\"abc\\",\\n \\"Id\\": \\"AliFace_0001234\\",\\n \\"Rate\\": 91.54\\n }\\n ],\\n \\"Height\\": 131,\\n \\"Y\\": 39,\\n \\"X\\": 49\\n }\\n ],\\n \\"HintWordsInfoList\\": [\\n {\\n \\"Context\\": \\"abc\\"\\n }\\n ],\\n \\"Suggestion\\": \\"block\\",\\n \\"ProgramCodeDataList\\": [\\n {\\n \\"Width\\": 402,\\n \\"Height\\": 413,\\n \\"Y\\": 0,\\n \\"X\\": 11\\n }\\n ],\\n \\"OCRDataList\\": [\\n \\"abc\\"\\n ],\\n \\"Frames\\": [\\n {\\n \\"URL\\": \\"http://xxx.xxx.com/xxx-0.jpg\\",\\n \\"Rate\\": 89.85\\n }\\n ],\\n \\"LogoDataList\\": [\\n {\\n \\"Type\\": \\"TV\\",\\n \\"Width\\": 106,\\n \\"Height\\": 106,\\n \\"Y\\": 68,\\n \\"Name\\": \\"abc\\",\\n \\"X\\": 140\\n }\\n ],\\n \\"Label\\": \\"normal\\",\\n \\"Scene\\": \\"ad\\",\\n \\"Rate\\": 99.91\\n }\\n ],\\n \\"TaskId\\": \\"img4wlJcb7p4wH4lAP3111111-123456\\"\\n }\\n ]\\n }\\n}","errorExample":""},{"type":"xml","example":"<Data>\\n <Results>\\n <Code>200</Code>\\n <Message>OK</Message>\\n <DataId>uuid-xxxx-xxx-1234</DataId>\\n <SubResults>\\n <Rate>99.63</Rate>\\n <Suggestion>block</Suggestion>\\n <Label>sexy</Label>\\n <Scene>porn</Scene>\\n </SubResults>\\n <SubResults>\\n <Label>politics</Label>\\n <Rate>91.54</Rate>\\n <Scene>terrorism</Scene>\\n <SfaceDataList>\\n <Faces>\\n <Id>AliFace_0001234</Id>\\n <Name>命中人名</Name>\\n <Rate>91.54</Rate>\\n </Faces>\\n <Height>131</Height>\\n <Width>97</Width>\\n <X>49</X>\\n <y>39</y>\\n </SfaceDataList>\\n <Suggestion>block</Suggestion>\\n </SubResults>\\n <SubResults>\\n <ProgramCodeDataList>\\n <Width>402</Width>\\n <Height>413</Height>\\n <X>11</X>\\n <y>0</y>\\n </ProgramCodeDataList>\\n <Frames>\\n <Rate>89.85</Rate>\\n <URL>http://xxx.xxx.com/xxx-0.jpg</URL>\\n </Frames>\\n <Frames>\\n <Rate>68.06</Rate>\\n <URL>http://xxx.xxx.com/xxx-1.jpg</URL>\\n </Frames>\\n <Rate>99.91</Rate>\\n <Suggestion>block</Suggestion>\\n <Label>ad</Label>\\n <Scene>ad</Scene>\\n </SubResults>\\n <SubResults>\\n <Rate>99.91</Rate>\\n <Suggestion>block</Suggestion>\\n <Label>drug</Label>\\n <Scene>live</Scene>\\n </SubResults>\\n <SubResults>\\n <LogoDataList>\\n <Name>xxx台</Name>\\n <Type>TV</Type>\\n <X>140</X>\\n <y>68</y>\\n <Width>106</Width>\\n <Height>106</Height>\\n </LogoDataList>\\n <Rate>99.9</Rate>\\n <Suggestion>block</Suggestion>\\n <Label>TV</Label>\\n <Scene>logo</Scene>\\n </SubResults>\\n <TaskId>img4wlJcb7p4wH4lAP3111111-123456</TaskId>\\n <ImageURL>http://xxx.xxx.xxx/xxx.jpg</ImageURL>\\n </Results>\\n</Data>\\n<RequestId>69B41AE8-1234-1234-1234-12D395695D2D</RequestId>","errorExample":""}]',
],
'ScanText' => [
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'methods' => ['post'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -398,22 +383,25 @@
'in' => 'formData',
'style' => 'repeatList',
'schema' => [
- 'description' => '1',
+ 'description' => '1.',
+ 'type' => 'array',
'items' => [
+ 'type' => 'object',
'properties' => [
- 'Content' => [
- 'description' => '',
- 'example' => '',
- 'required' => true,
- 'type' => 'string',
- ],
+ 'Content' => ['description' => 'The object to be detected. Each element in the JSON array is a text detection task structure.'."\n"
+ ."\n"
+ .'> - N Tasks are counted as N calls for billing purposes.'."\n"
+ .'- For questions about algorithm detection accuracy, join the Alibaba Cloud Visual Intelligence Platform consultation group on DingTalk (group ID: 23109592).', 'type' => 'string', 'required' => true, 'example' => '维修管道,联系weixin', 'title' => ''],
],
'required' => false,
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
- 'maxItems' => 10,
'required' => true,
- 'type' => 'array',
+ 'maxItems' => 10,
+ 'title' => '',
+ 'example' => '',
],
],
[
@@ -421,120 +409,323 @@
'in' => 'formData',
'style' => 'repeatList',
'schema' => [
- 'description' => '1',
+ 'description' => '1.',
+ 'type' => 'array',
'items' => [
+ 'type' => 'object',
'properties' => [
- 'Label' => [
- 'description' => '',
- 'example' => 'ad',
- 'required' => true,
- 'type' => 'string',
- ],
+ 'Label' => ['description' => 'The common scenario for text detection. Valid values:'."\n"
+ ."\n"
+ .'- spam: spam text detection'."\n"
+ ."\n"
+ .'- politics: sensitive text detection'."\n"
+ ."\n"
+ .'- abuse: abuse text detection'."\n"
+ ."\n"
+ .'- terrorism: terrorism text detection'."\n"
+ ."\n"
+ .'- porn: pornographic text detection'."\n"
+ ."\n"
+ .'- flood: flood text detection'."\n"
+ ."\n"
+ .'- contraband: contraband text detection'."\n"
+ ."\n"
+ .'- ad: advertising text detection.', 'type' => 'string', 'required' => true, 'example' => 'ad', 'title' => ''],
],
'required' => false,
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
- 'maxItems' => 10,
'required' => true,
- 'type' => 'array',
+ 'maxItems' => 10,
+ 'title' => '',
+ 'example' => '',
],
],
],
'responses' => [
200 => [
'schema' => [
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => 'C7CD87E3-57A5-4E2F-8A44-809F3554692C',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => 'C7CD87E3-57A5-4E2F-8A44-809F3554692C', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.',
+ 'type' => 'object',
'properties' => [
'Elements' => [
- 'description' => '',
+ 'description' => 'The sub-elements of the detection result.',
+ 'type' => 'array',
'items' => [
+ 'type' => 'object',
'properties' => [
- 'TaskId' => [
- 'description' => '',
- 'example' => 'txt6Vh5Fv0DAFy5hgdVRt3pqf-1s82jj',
- 'type' => 'string',
- ],
+ 'TaskId' => ['description' => 'The task ID.', 'type' => 'string', 'example' => 'txt6Vh5Fv0DAFy5hgdVRt3pqf-1s82jj', 'title' => ''],
'Results' => [
- 'description' => '',
+ 'description' => 'The detection results. If the result is empty, the system detected a hit on another Label. Expand the Labels and submit the request again.',
+ 'type' => 'array',
'items' => [
+ 'type' => 'object',
'properties' => [
- 'Suggestion' => [
- 'description' => '',
- 'example' => 'block',
- 'type' => 'string',
- ],
- 'Label' => [
- 'description' => '',
- 'example' => 'ad',
- 'type' => 'string',
- ],
- 'Rate' => [
- 'description' => '',
- 'example' => '99.91',
- 'format' => 'float',
- 'type' => 'number',
- ],
+ 'Suggestion' => ['description' => 'The recommended action. Valid values:'."\n"
+ ."\n"
+ .'- pass: The text is normal.'."\n"
+ ."\n"
+ .'- review: Manual review is required.'."\n"
+ ."\n"
+ .'- block: The text violates the rules. You can delete or restrict the text.', 'type' => 'string', 'example' => 'block', 'title' => ''],
+ 'Label' => ['description' => 'The category of the detection result.', 'type' => 'string', 'example' => 'ad', 'title' => ''],
+ 'Rate' => ['description' => 'The probability that the result belongs to this category. Value range: `[0.00-100.00]`. A higher value indicates a higher probability that the text belongs to this category.', 'type' => 'number', 'format' => 'float', 'example' => '99.91', 'title' => ''],
'Details' => [
- 'description' => '',
+ 'description' => 'The text detection results.',
+ 'type' => 'array',
'items' => [
+ 'type' => 'object',
'properties' => [
- 'Label' => [
- 'description' => '',
- 'example' => 'ad',
- 'type' => 'string',
- ],
+ 'Label' => ['description' => 'The category of the risky text that is hit.', 'type' => 'string', 'example' => 'ad', 'title' => ''],
'Contexts' => [
- 'description' => '',
+ 'description' => 'The information about the hit risk.',
+ 'type' => 'array',
'items' => [
+ 'type' => 'object',
'properties' => [
- 'Context' => [
- 'description' => '',
- 'example' => '',
- 'type' => 'string',
- ],
+ 'Context' => ['description' => 'The risky content that is hit in the detected text.', 'type' => 'string', 'example' => '联系weixin', 'title' => ''],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
- 'type' => 'array',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
- 'type' => 'array',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
- 'type' => 'array',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
- 'type' => 'array',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"C7CD87E3-57A5-4E2F-8A44-809F3554692C\\",\\n \\"Data\\": {\\n \\"Elements\\": [\\n {\\n \\"TaskId\\": \\"txt6Vh5Fv0DAFy5hgdVRt3pqf-1s82jj\\",\\n \\"Results\\": [\\n {\\n \\"Suggestion\\": \\"block\\",\\n \\"Label\\": \\"ad\\",\\n \\"Rate\\": 99.91,\\n \\"Details\\": [\\n {\\n \\"Label\\": \\"ad\\",\\n \\"Contexts\\": [\\n {\\n \\"Context\\": \\"联系weixin\\"\\n }\\n ]\\n }\\n ]\\n }\\n ]\\n }\\n ]\\n }\\n}","errorExample":""},{"type":"xml","example":"<ScanTextResponse>\\n <RequestId>4FCBCC61-6264-56DE-9CF3-44C014F63B75</RequestId>\\n <Data>\\n <Elements>\\n <TaskId>txt4OFqbn2s4WQ6kVA$dQGn9X-1vvHuZ</TaskId>\\n <Results>\\n <Suggestion>block</Suggestion>\\n <Details>\\n <Label>ad</Label>\\n <Contexts>\\n <Context>联系weixin </Context>\\n </Contexts>\\n </Details>\\n <Rate>99.91</Rate>\\n <Label>ad</Label>\\n </Results>\\n </Elements>\\n </Data>\\n</ScanTextResponse>","errorExample":""}]',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"C7CD87E3-57A5-4E2F-8A44-809F3554692C\\",\\n \\"Data\\": {\\n \\"Elements\\": [\\n {\\n \\"TaskId\\": \\"txt6Vh5Fv0DAFy5hgdVRt3pqf-1s82jj\\",\\n \\"Results\\": [\\n {\\n \\"Suggestion\\": \\"block\\",\\n \\"Label\\": \\"ad\\",\\n \\"Rate\\": 99.91,\\n \\"Details\\": [\\n {\\n \\"Label\\": \\"ad\\",\\n \\"Contexts\\": [\\n {\\n \\"Context\\": \\"联系weixin\\"\\n }\\n ]\\n }\\n ]\\n }\\n ]\\n }\\n ]\\n }\\n}","type":"json"}]',
+ 'title' => 'Text content moderation',
+ 'summary' => 'This topic describes the syntax and examples of the text content moderation operation ScanText.',
+ 'description' => '## Features'."\n"
+ .'Text content moderation combines behavioral and content analysis, using multi-dimensional models and multiple detection methods to identify sensitive information in text and mitigate content risks such as sensitive names, sensitive event descriptions, and sensitive remarks.'."\n"
+ .'Supported detection scenarios include: spam text detection, advertising text detection, sensitive text detection, terrorism text detection, abuse text detection, pornographic text detection, flood text detection, and contraband text detection.'."\n"
+ .'When you submit a detection task, specify the Labels parameter. You can combine multiple labels to perform multiple types of risk detection on the same text. If the API returns an empty result, no risks specified in Labels are detected.'."\n"
+ ."\n"
+ .'> - When multiple Tasks are detected simultaneously, you are charged based on the number of Tasks.'."\n"
+ .'- You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) for online assistance.'."\n"
+ .'- To learn more about the visual intelligence service, including API integration, usage, or consultation, join the Alibaba Cloud Visual Intelligence Platform consultation group on DingTalk (group ID: 23109592).'."\n"
+ ."\n"
+ .'## Getting started'."\n"
+ .'1. Create an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Sign Up** in the upper-right corner, and follow the instructions to create an account.'."\n"
+ .'2. Activate the service: Make sure you have activated [Content Moderation](https://vision.aliyun.com/imageaudit). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageaudit_public_cn#/open).'."\n"
+ .'3. Create an AccessKey: Make sure you have [created an AccessKey](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageaudit/2019-12-30/ScanText?lang=JAVA&sdkStyle=dara&params=%7B%22Tasks%22%3A%5B%7B%22Content%22%3A%22%E6%9C%AC%E6%A0%A1%E5%B0%8F%E9%A2%9D%E8%B4%B7%E6%AC%BE%EF%BC%8C%E5%AE%89%E5%85%A8%E3%80%81%E5%BF%AB%E6%8D%B7%E3%80%81%E6%96%B9%E4%BE%BF%E3%80%81%E6%97%A0%E6%8A%B5%E6%8A%BC%EF%BC%8C%E9%9A%8F%E6%9C%BA%E9%9A%8F%E8%B4%B7%EF%BC%8C%E5%BD%93%E5%A4%A9%E6%94%BE%E6%AC%BE%EF%BC%8C%E4%B8%8A%E9%97%A8%E6%9C%8D%E5%8A%A1%E3%80%82%E8%81%94%E7%B3%BBweixin%20123456%22%7D%5D%2C%22Labels%22%3A%5B%7B%22Label%22%3A%22spam%22%7D%2C%7B%22Label%22%3A%22politics%22%7D%2C%7B%22Label%22%3A%22abuse%22%7D%2C%7B%22Label%22%3A%22terrorism%22%7D%2C%7B%22Label%22%3A%22porn%22%7D%2C%7B%22Label%22%3A%22flood%22%7D%2C%7B%22Label%22%3A%22contraband%22%7D%2C%7B%22Label%22%3A%22ad%22%7D%5D%7D&tab=DEBUG) to debug the operation online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Content Moderation (imageaudit) AI category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the References as needed and invoke the operation.'."\n"
+ ."\n"
+ .'6. Sample code: For sample code in commonly used languages, see [Text content moderation sample code](~~477836~~).'."\n"
+ ."\n"
+ .'7. Direct client calls: Common client call methods for this operation include the following.'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Limits'."\n"
+ .'Each call to this operation can detect a maximum of 10,000 text characters.'."\n"
+ ."\n"
+ .'## Billing'."\n"
+ .'For information about the billable methods and pricing of text content moderation, see [Billing overview](~~202478~~).'."\n"
+ ."\n"
+ .'> The debugging operation below is a paid operation. To try it for free, go to the experience center. The corresponding experience entries are listed in the following table.'."\n"
+ ."\n"
+ .'| Feature | Experience center |'."\n"
+ .'| ---------------- | ------------------------------------------------------------ |'."\n"
+ .'| Spam text detection | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=RecognizeSpamText) |'."\n"
+ .'| Advertising text detection | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=RecognizeAdvertisingText) |'."\n"
+ .'| Sensitive text detection | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=RecognizePoliticsText) |'."\n"
+ .'| Terrorism text detection | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=RecognizeTerrorismText) |'."\n"
+ .'| Abuse text detection | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=RecognizeAbuseText) |'."\n"
+ .'| Pornographic text detection | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=RecognizePornText) |'."\n"
+ .'| Flood text detection | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=RecognizeFloodText) |'."\n"
+ .'| Contraband text detection | [Free debugging entry](https://vision.aliyun.com/experience/detail?&tagName=imageaudit&children=RecognizeContrabandText) |.',
'requestParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'We recommend that you use an SDK to call the text content moderation operation under the Visual AI Content Moderation category. SDKs are available in multiple programming languages. When making a call, select the SDK package for the Content Moderation (imageaudit) AI category. The SDK supports local files and arbitrary URLs for file parameters. For more information, see [SDK overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample code'."\n"
+ .'For sample code in commonly used languages, see [Text content moderation sample code](~~477836~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of text content moderation, see [Common error codes](~~146773~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Ensure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the experience debugging tool are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageaudit:ScanText',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
],
],
'endpoints' => [
- [
- 'regionId' => 'cn-shanghai',
- 'endpoint' => 'imageaudit.cn-shanghai.aliyuncs.com',
+ ['regionId' => 'cn-shanghai', 'regionName' => 'China (Shanghai)', 'areaId' => 'asiaPacific', 'areaName' => 'Asia Pacific', 'public' => 'imageaudit.cn-shanghai.aliyuncs.com', 'endpoint' => 'imageaudit.cn-shanghai.aliyuncs.com', 'vpc' => 'imageaudit-vpc.cn-shanghai.aliyuncs.com'],
+ ],
+ 'errorCodes' => [
+ ['code' => 'AuthFailed', 'message' => 'An error occurred while performing authorization. Please check your RAM configuration.', 'http_code' => 403, 'description' => 'An error occurred while performing authorization. Please check your RAM configuration.'],
+ ['code' => 'ClientError.IllegalArgument', 'message' => '请检查参数,如参数值所代表的数据库是否存在', 'http_code' => 400, 'description' => ''],
+ ['code' => 'EntityNotExist.Role', 'message' => '没有Ram权限,请联系主账号给你添加AliyunVIAPIFullAccess权限,操作流程可参考https://help.aliyun.com/document_detail/145025.htm', 'http_code' => 403, 'description' => ''],
+ ['code' => 'IllegalUrlParameter', 'message' => 'Url不合法,请检查url能否正常打开', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InternalError', 'message' => 'An error occurred to the algorithm service', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Algo', 'message' => 'An algorithm error occurred.', 'http_code' => 586, 'description' => ''],
+ ['code' => 'InternalError.Busy', 'message' => 'Server busy.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Cache', 'message' => 'cache error', 'http_code' => 585, 'description' => ''],
+ ['code' => 'InternalError.ConnectPool', 'message' => 'connect pool error', 'http_code' => 591, 'description' => ''],
+ ['code' => 'InternalError.DB', 'message' => 'database error', 'http_code' => 580, 'description' => ''],
+ ['code' => 'InternalError.Decode', 'message' => 'Failed to decode the image.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Env', 'message' => 'Failed to initilize the environment.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Frame', 'message' => 'frame error', 'http_code' => 595, 'description' => ''],
+ ['code' => 'InternalError.MiddleWare', 'message' => 'middleware error', 'http_code' => 587, 'description' => ''],
+ ['code' => 'InternalError.Model', 'message' => 'Failed to load the model.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Process', 'message' => 'An error occurred during inference.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Remote', 'message' => 'The request processing has failed due to some unknown error.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Server', 'message' => 'The request processing has failed due to some unknown error.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Timeout', 'message' => 'The request has timed out.', 'http_code' => 581, 'description' => ''],
+ ['code' => 'InternalServerError', 'message' => 'A server error occurred while processing your request.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InvalidAccessKeyId.Inactive', 'message' => 'The AccessKey ID is invalid.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidAccessKeyId.NotFound', 'message' => 'AccessKeyId未找到,请检查AccessKeyId和AccessKeySecret是否填写正确。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidAccessKeySecret', 'message' => 'AccessKeyId或AccessKeySecret填写错误,请检查AccessKeyId和AccessKeySecret是否填写正确。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidAction.NotFound', 'message' => '能力未找到,请检查类目与能力是否匹配,检查访问域名与能力是否匹配,关于访问域名可参考:https://help.aliyun.com/document_detail/143103.htm。SDK接入请参考:https://help.aliyun.com/document_detail/145033.html,选择合适编程语言根据实例代码作相关修改进行接入。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidApi.ForbiddenInvoke', 'message' => '调用受限,请检查您调用的能力是否为受限能力,受限能力需要在控制台https://vision.console.aliyun.com/找到相应能力申请经过审批之后才能调用。如非上述情况,请检查账号是否欠费', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidApi.NotPurchase', 'message' => 'specified api is not purchase', 'http_code' => 403, 'description' => ''],
+ ['code' => 'InvalidApi.OutOfService', 'message' => '产品未开通,请开通产品:https://common-buy.aliyun.com/?commodityCode=viapi_imageaudit_public_cn#/open', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Content', 'message' => '请参考算法文档检查文件内容,更换包含符合算法要求的', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Decode', 'message' => '请检查文件是否能够正常打开', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Download', 'message' => '文件无法下载,请检查链接是否可访问和本地网络情况 - 非上海OSS文件链接请参考:https://help.aliyun.com/document_detail/155645.html', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.REGION', 'message' => '文件链接地域不对,非上海OSS文件链接请参考:https://help.aliyun.com/document_detail/155645.html', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Resolution', 'message' => '文件分辨率超出限制,请检查文件分辨率和内容,修改文件分辨率后重试', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Type', 'message' => '文件类型错误,请检查文件类型 - 请参考算法API文档,使用算法支持的文件类型', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Unsafe', 'message' => 'Risky file URL.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.URL', 'message' => '文件无法下载,请检查链接是否可访问和本地网络情况 - 非上海OSS文件链接请参考:https://help.aliyun.com/document_detail/155645.html', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Content', 'message' => '请参考算法文档检查图片内容,更换包含符合算法要求的', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Decode', 'message' => '请检查图片是否能够正常打开', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Download', 'message' => '图片无法下载,请检查链接是否可访问和本地网络情况 - 非上海OSS图片链接请参考:https://help.aliyun.com/document_detail/155645.html', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.NotFound', 'message' => 'The image is not found. Make sure that it is accessible over the Internet.', 'http_code' => 404, 'description' => ''],
+ ['code' => 'InvalidImage.NotFoundFace', 'message' => '图像中没找到人脸,请检查您的图像中是否包含人脸或人脸太小', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.REGION', 'message' => '图片链接地域不对,非上海OSS图片链接请参考:https://help.aliyun.com/document_detail/155645.html', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Resolution', 'message' => '文件分辨率超出限制,请检查文件分辨率和内容,修改文件分辨率后重试', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Restriction', 'message' => 'The file size or resolution of the image is invalid.', 'http_code' => 480, 'description' => ''],
+ ['code' => 'InvalidImage.Timeout', 'message' => 'Failed to download the file due to timeout.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Type', 'message' => '图片类型错误,请检查图片类型 - 请参考算法API文档,使用算法支持的图片类型', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Unaccessable', 'message' => 'Image is unaccessable.', 'http_code' => 403, 'description' => ''],
+ ['code' => 'InvalidImage.Unsafe', 'message' => 'Risky file URL.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.URL', 'message' => '图片链接非法,请检查图片链接是否可访问 - 非上海OSS图片链接请参考:https://help.aliyun.com/document_detail/155645.html', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImageType', 'message' => 'Invalid image type.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter', 'message' => 'Invalid parameter value.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter.BadRequest', 'message' => 'The request parameter or the data has an error.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter.Format', 'message' => 'Invalid parameter format.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter.NotFound', 'message' => 'Invalid parameter value.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter.TooLarge', 'message' => 'The file size exceeds the limit.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidRamRole', 'message' => '没有Ram权限,请联系主账号给你添加AliyunVIAPIFullAccess权限,操作流程可参考https://help.aliyun.com/document_detail/145025.htm', 'http_code' => 403, 'description' => ''],
+ ['code' => 'InvalidResult', 'message' => '参数错误,请参考文档检查参数值,检查文件内容。请检查是否图片内容不完整或者太模糊等。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidSide', 'message' => 'Specified parameter Side is not valid. 请参考文档填写正确的Side参数', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidTask.N.ImageTimeMillisecond', 'message' => 'Invalid task value.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidTimeStamp.Expired', 'message' => '时间戳过期,请更新时间戳', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidVersion', 'message' => 'Specified parameter Version is not valid', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingAccessKeyId', 'message' => 'AccessKeyId未填写,请检查AccessKeyId和AccessKeySecret是否填写正确。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingFileURL', 'message' => 'FileURL is required for this operation.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingImageURL', 'message' => 'ImageURL is required for this operation.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingLimit', 'message' => 'Limit is required for this operation', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingParameter', 'message' => 'A required parameter is not specified.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingScene', 'message' => 'Scene is required for this operation.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingTasks', 'message' => 'Tasks is required for this operation.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'ParameterError', 'message' => 'The parameter is invalid. Please check again.', 'http_code' => 400, 'description' => 'The parameter is invalid. Please check again.'],
+ ['code' => 'RamRoleAuth', 'message' => 'Failed to authenticate the RAM user.', 'http_code' => 403, 'description' => ''],
+ ['code' => 'ServiceUnavailable', 'message' => 'The service is unavailable.', 'http_code' => 503, 'description' => 'The service is unavailable.'],
+ ['code' => 'SignatureDoesNotMatch', 'message' => '签名不正确,请重新计算签名。关于签名可参考文档:https://help.aliyun.com/document_detail/144904.html', 'http_code' => 400, 'description' => ''],
+ ['code' => 'SignatureNonceUsed', 'message' => '签名已经被使用过,请重新计算签名。关于签名可参考文档:https://help.aliyun.com/document_detail/144904.html', 'http_code' => 400, 'description' => ''],
+ ['code' => 'Throttling', 'message' => 'The request was denied due to QPS limits.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'Throttling.User', 'message' => 'The request was denied due to QPS limits.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'Timeout', 'message' => 'The request has timed out.', 'http_code' => 408, 'description' => 'The request has timed out.'],
+ ['code' => 'Unauthorized', 'message' => '没有Ram权限,请联系主账号给你添加AliyunVIAPIFullAccess权限,操作流程可参考https://help.aliyun.com/document_detail/145025.htm', 'http_code' => 400, 'description' => ''],
+ ['code' => 'UnsupportedHTTPMethod', 'message' => 'The HTTP request method is not supported.', 'http_code' => 403, 'description' => ''],
+ ],
+ 'changeSet' => [],
+ 'ram' => [
+ 'productCode' => 'VisualIntelligenceAPI',
+ 'productName' => 'Visual Intelligence API',
+ 'ramCodes' => ['viapi-imageseg', 'viapi-imageaudit', 'viapi-ocr', 'viapi-objectdet', 'viapi-imageenhan', 'viapi-videorecog', 'viapi-imageprocess', 'viapi', 'viapi-ekyc', 'viapi-imgsearch', 'viapi-goodstech', 'viapi-facebody', 'viapi-threedvision', 'viapi-videoenhan', 'viapi-imagerecog', 'viapi-videoseg', 'viapi-regen', 'viapi-aigen'],
+ 'ramLevel' => 'SERVICE',
+ 'ramConditions' => [],
+ 'ramActions' => [
+ [
+ 'apiName' => 'ScanImage',
+ 'description' => '',
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'viapi-imageaudit:ScanImage',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'ScanText',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageaudit:ScanText',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ 'resourceTypes' => [],
],
];