|
@@ -5,7 +5,7 @@ from alibabacloud_green20220302.client import Client as Green20220302Client
|
|
|
from alibabacloud_tea_openapi import models as open_api_models
|
|
|
from alibabacloud_green20220302 import models as green_20220302_models
|
|
|
from alibabacloud_tea_util import models as util_models
|
|
|
-from Ansjer.config import ALI_ACCESS_KEY_ID, ALI_ACCESS_KEY_SECRET
|
|
|
+from Ansjer.config import ALI_ACCESS_KEY_ID, ALI_ACCESS_KEY_SECRET, LOGGER
|
|
|
|
|
|
TEXT_ILLEGAL_LABEL_LIST = ['political_content', 'profanity', 'contraband', 'sexual_content', 'violence',
|
|
|
'negative_content', 'religion', 'cyberbullying']
|
|
@@ -70,6 +70,7 @@ class ContentSecurity:
|
|
|
runtime = util_models.RuntimeOptions()
|
|
|
res = client.image_moderation_with_options(image_moderation_request, runtime)
|
|
|
print(res)
|
|
|
+ LOGGER.info('图片审核响应内容:{}'.format(res))
|
|
|
if res.status_code != 200:
|
|
|
return False
|
|
|
# 获取审核结果
|