All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::Aligreen::KeywordLib

Last Updated:Apr 29, 2025

ALIYUN::Aligreen::KeywordLib is used to create a custom text library.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

KeywordLibName

String

Yes

Yes

The name of the text library.

None.

ResourceType

String

Yes

No

The moderation scenario to which the text library applies.

Valid values:

  • TEXT: text anti-spam.

  • IMAGE: advertisement violation detection.

  • VOICE: audio anti-spam.

BizTypes

List

No

Yes

The business scenarios.

For more information, see CreateBizType.

Category

String

No

No

The category of the text library.

Valid values:

  • BLACK: blacklist.

  • WHITE: whitelist.

  • REVIEW: review list.

Enable

Boolean

No

Yes

Specifies whether to enable the text library.

Valid values:

  • true (default)

  • false

Language

String

No

No

The language used by the text library.

Valid values:

  • zh: Chinese.

  • en: English.

LibType

String

No

No

The category of the text library in each moderation scenario.

Valid values:

  • Valid values when ResourceType is set to TEXT:

    • textKeyword: a text library against which terms in text are matched.

    • similarText: a text library against which text patterns are matched.

  • Valid value when ResourceType is set to IMAGE:

    • textKeyword: a text library against which terms extracted from images are matched.

  • Valid value when ResourceType is set to VOICE:

    • voiceText: a text library against which terms converted from audio are matched.

MatchMode

String

No

No

The matching mode.

Valid values:

  • fuzzy: fuzzy match.

  • precise: exact match.

Return values

Fn::GetAtt

  • MatchMode: the matching mode.

  • Category: the category of the text library.

  • Language: the language used by the text library.

  • BizTypes: the business scenarios.

  • Enable: indicates whether the text library is enabled.

  • ResourceType: the moderation scenario to which the text library applies.

  • LibType: the category of the text library in each moderation scenario.

  • KeywordLibId: the ID of the text library.

  • KeywordLibName: the name of the text library.

Examples

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"
        ]
      }
    }
  }
}