AddSmarttagTemplate

Updated at:

Adds an analysis template for a smart tagging job.

Operation description

The template added by this operation specifies the analysis algorithms used in a smart tagging job. You can combine different parameters based on your actual business requirements.

QPS limit

The QPS limit for a single user is 100 calls per second. If the limit is exceeded, API calls are throttled, which may affect your business. Make API calls at a reasonable rate. For more information, see QPS limit.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

mts:AddSmarttagTemplate

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

TemplateName

string

Yes

The custom template name. The name can contain Chinese and English characters and must be up to 120 characters in length.

template-example-****

Industry

string

Yes

The industry of the file to be analyzed. Default value: common (general industry). Select an appropriate industry so that the system can match the algorithm combinations suitable for the industry in the background. Valid values:

  • microVideo: short video industry.

  • common: general industry.

common

Scene

string

Yes

The scenarios of the file to be analyzed. Select appropriate scenarios so that the system can match the applicable algorithm combinations in the background. Valid values:

  • search: search scenario.

  • recommend: recommendation scenario.

  • Default value: search.

search

AnalyseTypes

string

Yes

The analysis types. You can select multiple types and separate them with commas (,). The following types are supported:

Note

Make sure that the file to be analyzed contains the results of the selected analysis types. Otherwise, the query result may be empty. For example, if you select ocr as the analysis type but the uploaded image does not contain OCR results, an empty result is returned.

  • ocr: recognizes labels from text in images.

  • asr: recognizes labels from audio speech.

  • classification: video categorization.

  • shows: recognizes TV shows in videos.

  • face: recognizes faces in videos or images.

  • role: recognizes character roles in videos.

  • object: recognizes objects in videos.

  • tvstation: recognizes TV station logos in videos.

  • action: recognizes action events in videos.

  • emotion: recognizes facial expressions in videos.

  • landmark: recognizes landmarks in videos.

  • scene: recognizes scenarios in videos.

  • movieIp: recognizes movie IPs in videos. This type is currently supported only in the China (Beijing) region.

  • subtitle: caption fetch feature.

The mapping between analysis types and billable items is as follows:

Note

Fees are generated for the analysis types enabled by configuring the smart tagging feature through this operation. For billing standards, see Billable items.

  • Video categorization and structured labels: All analysis types except face, ocr, and asr belong to this billable item. Fees are not accumulated.

  • Video face recognition: enabled when face is selected.

  • Video text recognition labels: enabled when ocr is selected.

  • Video speech recognition labels: enabled when asr is selected.

ocr

FaceCategoryIds

string

No

The IDs of the face libraries used for recognition. You can select multiple IDs and separate them with commas (,). You can specify system face library IDs and custom face library IDs. The system face library IDs are as follows:

  • celebrity: celebrities.

  • politician: political figures.

  • sensitive: sensitive figures.

For custom face library IDs, see Register custom faces.

celebrity

FaceCustomParamsConfig

string

No

The parameters of the face algorithm in JSON string format. Currently, you can adjust the face detection threshold and face recognition threshold.

  • faceDetThreshold: the face detection threshold. The default value is 0.999. This parameter takes effect only for unknown face analysis.

  • faceRegThreshold: the face recognition threshold. The default value is 0.9.

{ "faceDetThreshold":0.999, "faceRegThreshold":0.9 }

ObjectGroupIds

string

No

The IDs of the object libraries used for recognition. You can select multiple IDs and separate them with commas (,). You can specify system object library IDs and custom object library IDs. The system object library IDs are as follows:

  • general: general.

  • item: commodities.

  • weapon: weapons.

  • animal: animals.

For custom object library IDs, see Register custom entities.

general,item,weapon,animal

LandmarkGroupIds

string

No

The IDs of the landmark libraries used for recognition. You can select multiple IDs and separate them with commas (,). You can specify system landmark library IDs and custom landmark library IDs. The system landmark library IDs are as follows:

  • common: general.

For custom landmark library IDs, see Register custom entity photos.

common

IsDefault

boolean

No

Specifies whether to set the template as the default template. If the template is set as the default template and no transcoding template is specified during transcoding, the default template is used. Valid values: true and false. Default value: false. An Alibaba Cloud account can have only one default template. An error is reported if you set multiple default templates.

true

LabelType

string

No

The tagging type. The following types are supported:

  • auto: machine tagging.

  • hmi: human-machine collaboration.

hmi

LabelVersion

string

No

The smart tagging version. Default value: 1.0. Valid values:

  • 1.0: Smart Tagging 1.0.

  • 2.0: Smart Tagging 2.0 (CPV tags).

  • 2.0-custom: Smart Tagging 2.0-custom (custom model for CPV tags).

1.0

KnowledgeConfig

string

No

The scope of knowledge graph information fields recognized in the returned tag results in Smart Tagging 2.0 and 2.0-custom modes. For more information about knowledge graph information, see Knowledge graph fields in smart tagging operations. If this parameter is not specified, is empty, or is invalid (not a JSON string), the following fields are returned by default:

  • movie:

    • name: the IP name.

    • alias: the IP alias.

    • chnl: the category.

    • genre: the genre.

    • country: the producing country or region.

    • language: the language.

    • releaseYear: the release year.

  • music:

    • songName: the song name.

    • artistName: the artist name.

    • artistArea: the region of the artist, such as Chinese, Japanese, Korean, European and American, or other.

    • albumName: the album name.

  • person:

    • name: the name.

    • gender: the gender.

    • citizenship: the citizenship.

    • occupation: the occupation.

    • classification: the classification.

    • nationality: the nationality.

    • birthPlace: the birthplace.

    • birthDate: the birth date.

  • landmark:

    • name: the name.

    • nameEn: the English name.

    • description: the description.

    • address: the address.

  • item:

    • brandName: the brand name.

    • finegrainName: the fine-grained description.

{ "movie":"name,alias,chnl,genre", "music":"songName,artistName", "person":"name,gender" }

KeywordConfig

string

No

The keyword tag configuration. The type field specifies the part-of-speech categories. You can select multiple categories and separate them with commas (,). The following categories are supported:

  • name: person name.

  • location: location name.

  • organization: organization name.

  • other: other.

Note

If KeywordConfig is not passed, the Keyword field is invalid (not a JSON string), KeywordsConfig does not contain the type field, or the type field is invalid, keywords of all types are returned by default.

"type": "name,location,organization,other" }

LabelCustomCategoryIds

string

No

The IDs of the custom tag libraries used for recognition. You can select multiple IDs and separate them with commas (,).

ab***cd,ef***hi

LabelCustomParamsConfig

string

No

The parameter settings for additional custom label libraries. Currently, only threshold settings are supported. {"threshold": xxx}

{"threshold": 0.4}

TemplateConfig

string

No

The smart tagging template configuration, passed as a JSON string. Configuration items include the industry, scenarios, and analysis types. The passed configuration items overwrite the corresponding original configurations in the template.

{"Industry":"common","Scene":"search","AnalyseTypes":"ocr,asr,nlp"}

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

7B117AF5-2A16-412C-B127-FA6175EDAS3Q

TemplateId

string

The template ID. We recommend that you save this ID for subsequent calls to other related operations.

05de22f255284c7a8d2aab535dde****

Examples

Success response

JSON format

{
  "RequestId": "7B117AF5-2A16-412C-B127-FA6175EDAS3Q",
  "TemplateId": "05de22f255284c7a8d2aab535dde****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.