ALIYUN::Aligreen::KeywordLib

ALIYUN::Aligreen::KeywordLib类型用于创建文本库。

语法

{
  "Type": "ALIYUN::Aligreen::KeywordLib",
  "Properties": {
    "KeywordLibName": String,
    "ResourceType": String,
    "BizTypes": List,
    "Category": String,
    "Enable": Boolean,
    "Language": String,
    "LibType": String,
    "MatchMode": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

KeywordLibName

String

文本库名称。

ResourceType

String

文本库应用的检测场景类型。

取值:

  • TEXT:文本反垃圾

  • IMAGE:图文违规检测

  • VOICE:语音反垃圾

BizTypes

List

业务场景列表。

更多信息,请参见创建业务场景

Category

String

文本库类型。

取值:

  • BLACK:风险名单

  • WHITE:可信名单

  • REVIEW:疑似名单

Enable

Boolean

是否启用文本库。

取值:

  • true(默认):启用

  • false:停用

Language

String

文本库使用的语言。

取值:

  • zh:中文

  • en:英文

LibType

String

各应用场景中的文本库类型。

取值:

  • 文本反垃圾

    • textKeyword:关键词文本库

    • similarText:相似文本库

  • 图文违规识别

    textKeyword:图片关键词文本库

  • 语音反垃圾

    voiceText:语音关键词文本库

MatchMode

String

匹配方式。

取值:

  • fuzzy:模糊匹配

  • precise:精确匹配

返回值

Fn::GetAtt

  • MatchMode:匹配方式。

  • Category:文本库类型。

  • Language:文本库使用的语言。

  • BizTypes:业务场景列表。

  • Enable:是否启用文本库。

  • ResourceType:文本库应用的检测场景类型。

  • LibType:各应用场景中的文本库类型。

  • KeywordLibId:文本库ID。

  • KeywordLibName:文本库名称。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ResourceType:
    Type: String
    Description:
      en: 'The moderation scenario to which the text library applies. Valid values:TEXT: text anti-spam、IMAGE: ad violation detection、VOICE: audio anti-spam.'
    AllowedValues:
      - TEXT
      - IMAGE
      - VOICE
    Required: true
  KeywordLibName:
    Type: String
    Description:
      en: The name of the keyword library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::Aligreen::KeywordLib
    Properties:
      ResourceType:
        Ref: ResourceType
      KeywordLibName:
        Ref: KeywordLibName
Outputs:
  MatchMode:
    Description: The matching method.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - MatchMode
  Category:
    Description: The category of the text library.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Category
  Language:
    Description: Language used by the text Library.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Language
  BizTypes:
    Description: The business scenario.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - BizTypes
  Enable:
    Description: Specifies whether to enable text library.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Enable
  ResourceType:
    Description: The moderation scenario to which the text library applies.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ResourceType
  LibType:
    Description: The category of the text library in each moderation scenario.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - LibType
  KeywordLibId:
    Description: The ID of the primary key of the keyword library.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - KeywordLibId
  KeywordLibName:
    Description: The name of the keyword library defined by the customer.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - KeywordLibName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ResourceType": {
      "Type": "String",
      "Description": {
        "en": "The moderation scenario to which the text library applies. Valid values:TEXT: text anti-spam、IMAGE: ad violation detection、VOICE: audio anti-spam."
      },
      "AllowedValues": [
        "TEXT",
        "IMAGE",
        "VOICE"
      ],
      "Required": true
    },
    "KeywordLibName": {
      "Type": "String",
      "Description": {
        "en": "The name of the keyword library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_)."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::Aligreen::KeywordLib",
      "Properties": {
        "ResourceType": {
          "Ref": "ResourceType"
        },
        "KeywordLibName": {
          "Ref": "KeywordLibName"
        }
      }
    }
  },
  "Outputs": {
    "MatchMode": {
      "Description": "The matching method.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "MatchMode"
        ]
      }
    },
    "Category": {
      "Description": "The category of the text library.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Category"
        ]
      }
    },
    "Language": {
      "Description": "Language used by the text Library.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Language"
        ]
      }
    },
    "BizTypes": {
      "Description": "The business scenario.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "BizTypes"
        ]
      }
    },
    "Enable": {
      "Description": "Specifies whether to enable text library.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Enable"
        ]
      }
    },
    "ResourceType": {
      "Description": "The moderation scenario to which the text library applies.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ResourceType"
        ]
      }
    },
    "LibType": {
      "Description": "The category of the text library in each moderation scenario.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "LibType"
        ]
      }
    },
    "KeywordLibId": {
      "Description": "The ID of the primary key of the keyword library.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "KeywordLibId"
        ]
      }
    },
    "KeywordLibName": {
      "Description": "The name of the keyword library defined by the customer.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "KeywordLibName"
        ]
      }
    }
  }
}