AddSmarttagTemplate

更新时间:
复制 MD 格式

Add an analysis template for a DataQ - Smart Tag Service job.

Operation description

This API adds an analysis template that specifies the algorithms used in a DataQ - Smart Tag Service job. Configure parameters as needed to meet your business requirements.

QPS limit

This API supports up to 100 requests per second per user. Exceeding this limit triggers rate limiting, which may affect your business. Use this API responsibly. For more information, see QPS limits.

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

Custom template name. The string can contain letters and Chinese characters. Maximum length: 120 characters.

template-example-****

Industry

string

Yes

Industry of the file to analyze. Default value: common (general industry). Select the appropriate industry so the backend can match the best algorithm combination. Valid values:

  • microVideo: Short video industry.

  • common: General industry.

common

Scene

string

Yes

Usage scenario of the file to analyze. Select the appropriate scenario so the backend can match the best algorithm combination. Valid values:

  • search: Search scenario.

  • recommend: Recommendation scenario.

  • Default value: search.

search

AnalyseTypes

string

Yes

Analysis types. You can select multiple types separated by commas (,). Supported types:

Note

Make sure your file contains results for the selected analysis types. Otherwise, queries may return empty results. For example, if you select ocr but the uploaded image contains no text, the query returns no results.

  • ocr: Detect labels from text in images.

  • asr: Detect labels from speech in audio.

  • classification: Video classification.

  • shows: Detect TV programs in videos.

  • face: Detect faces in videos or images.

  • role: Detect character roles in videos.

  • object: Detect objects in videos.

  • tvstation: Detect TV station logos in videos.

  • action: Detect action events in videos.

  • emotion: Detect facial expressions in videos.

  • landmark: Detect landmarks in videos.

  • scene: Detect scenes in videos.

  • movieIp: Detect film and TV intellectual property (IP) in videos. This type is only available in the China (Beijing) region.

  • subtitle: Extract subtitles.

The relationship between analysis types and billing items is as follows:

Note

Enabling analysis types through this API incurs charges. For pricing details, see Billing items.

  • Video classification + structured tags: All analysis types except face, ocr, and asr fall under this billing item. Charges do not stack.

  • Video facial recognition: Enable face.

  • Video text recognition tags: Enable ocr.

  • Video speech recognition tags: Enable asr.

ocr

FaceCategoryIds

string

No

List of face library IDs to use for recognition. You can select multiple IDs separated by commas (,). You can specify system face library IDs and custom face library IDs. System face library IDs include the following:

  • celebrity: Celebrity figures.

  • politician: Political figures.

  • sensitive: Sensitive figures.

  • For custom face library IDs, see Register custom face library.

celebrity

FaceCustomParamsConfig

string

No

Parameters for facial recognition algorithms, formatted as a JSON string. Currently supports adjusting face detection and recognition thresholds.

  • faceDetThreshold: Face detection threshold. Default: 0.999. Applies only to unknown faces.

  • faceRegThreshold: Face recognition threshold. Default: 0.9.

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

ObjectGroupIds

string

No

List of object library IDs to use for recognition. You can select multiple IDs separated by commas (,). You can specify system object library IDs and custom object library IDs. System object library IDs include the following:

  • general: General objects.

  • item: Products.

  • weapon: Weapons.

  • animal: Animals.

  • For custom object library IDs, see Register custom entity.

general,item,weapon,animal

LandmarkGroupIds

string

No

List of landmark library IDs to use for recognition. You can select multiple IDs separated by commas (,). You can specify system landmark library IDs and custom landmark library IDs. System landmark library IDs include the following:

common

IsDefault

boolean

No

Set as the default template. If set to true, this template is used automatically when transcoding if no template is specified. Valid values: true (yes), false (no). Default: false. Each Alibaba Cloud account can have only one default template. Setting another default template returns an error.

true

LabelType

string

No

Annotation type. Supported types:

  • auto: Machine-generated tags.

  • hmi: Human-in-the-loop tagging.

hmi

LabelVersion

string

No

Specify the DataQ - Smart Tag Service version. Default: "1.0".

  • 1.0: DataQ - Smart Tag Service 1.0

  • 2.0: DataQ - Smart Tag Service 2.0 (CPV tags)

  • 2.0-custom: DataQ - Smart Tag Service 2.0-custom (CPV custom model)

1.0

KnowledgeConfig

string

No

In DataQ - Smart Tag Service 2.0 and 2.0-custom modes, specify the knowledge graph fields to return in tag results. For more information about knowledge graph fields, see Knowledge graph fields in DataQ - Smart Tag Service. If KnowledgeConfig is empty, missing, or not a valid JSON string, the following fields are returned by default:

  • movie:

    • name: IP name

    • alias: IP alias

    • chnl: Category

    • genre: Genre

    • country: Production country or region

    • language: Language

    • releaseYear: Release year

  • music:

    • songName: Song name

    • artistName: Artist name

    • artistArea: Artist region (Chinese, Japanese, Korean, Western, or Other)

    • albumName: Album name

  • person:

    • name: Name

    • gender: Gender

    • citizenship: Nationality

    • occupation: Occupation

    • classification: Type

    • nationality: Ethnicity

    • birthPlace: Birthplace

    • birthDate: Birth date

  • landmark

    • name: Name

    • nameEn: English name

    • description: Description

    • address: Address

  • item

    • brandName: Brand

    • finegrainName: Fine-grained description

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

KeywordConfig

string

No

Keyword tag configuration. type specifies part-of-speech categories. You can select multiple categories separated by commas (,). Supported categories:

  • name: Person names

  • location: Place names

  • organization: Organization names

  • other: Other

Note

If KeywordConfig is missing, invalid (not a JSON string), or lacks a valid type field, all keyword types are returned by default.

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

LabelCustomCategoryIds

string

No

List of custom tag library IDs to use for recognition. You can select multiple IDs separated by commas (,).

ab***cd,ef***hi

LabelCustomParamsConfig

string

No

Additional parameter settings for custom tag libraries. Currently supports only threshold configuration. {"threshold": xxx}

{"threshold": 0.4}

TemplateConfig

string

No

Response elements

Element

Type

Description

Example

object

Response parameters.

RequestId

string

Request ID.

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

TemplateId

string

Template ID. Save this ID for future API calls.

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.