Updated on 2023-05-09 GMT+08:00

Creating a Dataset Version

Create a new version for a dataset.

dataset.create_version(name=None, version_format=None, label_task_type=None, label_task_id=None, **kwargs)

Sample Code

Example 1: Create a new version for a dataset.
from modelarts.session import Session
from modelarts.dataset import Dataset
session = Session()

dataset = Dataset(session, dataset_id)
create_version_resp = dataset.create_version(name="V001", version_format="Default", label_task_type=0, description="version 001")

Example 2: Create a dataset based on a labeling task.

from modelarts.session import Session
from modelarts.dataset import Dataset
session = Session()

dataset = Dataset(session, dataset_id)
create_version_resp = dataset.create_version(label_task_id="IbAhFai5KXWC3gthUfz", description="dataset version from label task")

Parameters

Table 1 Request parameters

Parameter

Mandatory

Type

Description

name

No

String

Version name that consists of 1 to 32 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

version_format

No

String

Format of a dataset version. The options are as follows:

  • Default

label_task_type

No

Integer

Labeling type of a dataset version. The options are as follows:

  • 0: image classification
  • 1: object detection
  • 3: image segmentation
  • 100: text classification
  • 101: named entity recognition
  • 102: text triplet
  • 200: sound classification
  • 201: speech content
  • 202: speech paragraph labeling
  • 400: table dataset
  • 600: video labeling
  • 900: custom format

label_task_id

No

String

ID of a labeling task based on which a dataset version is created.

description

No

String

Version description consisting of 0 to 256 characters without special characters (!<>=&"'). The parameter is left blank by default.