Updated on 2024-05-30 GMT+08:00

Modifying a Dataset

Function

Modify basic information about a dataset, such as name, description, version, and labels.

Debugging

You can debug this API in API Explorer which supports automatic authentication. API Explorer can automatically generate SDK code examples and provide the SDK code example debugging.

URI

PUT /v2/{project_id}/datasets/{dataset_id}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

dataset_id

Yes

String

Dataset ID

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

add_labels

No

Array of Label objects

List of added labels

current_version_id

No

String

Current version ID of a dataset

dataset_name

No

String

Dataset name, which can contain 1 to 100 characters. Only letters, digits, numbers, underscores (_) and hyphens (-) are supported.

delete_labels

No

Array of Label objects

List of labels to be deleted

description

No

String

Dataset description. The value contains 0 to 256 characters. Special characters (^!<>=&") are not allowed.

update_labels

No

Array of Label objects

List of labels to be updated

Table 3 Label

Parameter

Mandatory

Type

Description

attributes

No

Array of LabelAttribute objects

Multi-dimensional attribute of a label. For example, if the label is music, attributes can be genre or artist.

name

No

String

Label name

property

No

LabelProperty object

Basic attribute key-value pair of a label, such as color and shortcut keys.

type

No

Integer

Label type. Options:

  • 0: image classification

  • 1: object detection

  • 3: image segmentation

  • 100: text classification

  • 101: named entity recognition

  • 102: text triplet relationship

  • 103: text triplet entity

  • 200: sound classification

  • 201: speech content

  • 202: speech paragraph labeling

  • 600: video labeling

Table 4 LabelAttribute

Parameter

Mandatory

Type

Description

default_value

No

String

Default value of a label attribute

id

No

String

Label attribute ID, which can be obtained in the label list.

name

No

String

Label attribute name, which can contain a maximum of 64 characters. Special characters (!<>=&"') cannot be included.

type

No

String

Label attribute type. Options:

  • text: Select a text label.

  • select: Select from the drop-down list.

values

No

Array of LabelAttributeValue objects

List of label attribute values

Table 5 LabelAttributeValue

Parameter

Mandatory

Type

Description

id

No

String

Label attribute value ID

value

No

String

Label attribute value

Table 6 LabelProperty

Parameter

Mandatory

Type

Description

@modelarts:color

No

String

Label color, which is a hexadecimal code of the color. The default value is left blank. For example, #FFFFF0.

@modelarts:default_shape

No

String

Default shape of an object detection label (dedicated attribute). By default, this parameter is left blank. Options:

  • bndbox: rectangle

  • polygon: polygon

  • circle: circle

  • line: straight line

  • dashed: dashed line

  • point: point

  • polyline: polyline

@modelarts:from_type

No

String

Type of the head entity in the triplet relationship label. This attribute must be specified when a relationship label is created. This parameter is used only for the text triplet dataset.

@modelarts:rename_to

No

String

The new name of the label

@modelarts:shortcut

No

String

Label shortcut key, for example, D. By default, this parameter is left blank.

@modelarts:to_type

No

String

Type of the tail entity in the triplet relationship label. This attribute must be specified when a relationship label is created. This parameter is used only for the text triplet dataset.

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

dataset_id

String

Dataset ID

Request Example

Run the following command to update a dataset:

{
  "description" : "just a test",
  "add_labels" : [ {
    "name" : "Ants",
    "type" : 0,
    "property" : {
      "@modelarts:color" : "#3399ff"
    }
  } ]
}

Response Example

Status code: 200

OK

{
  "dataset_id" : "gfghHSokody6AJigS5A"
}

Status Code

Status Code

Description

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

Error Code

For details, see Error Codes.