Help Center/ ModelArts/ SDK Reference/ Data Management/ Managing Labeling Jobs/ Obtaining the Labeling Job List of a Dataset
Updated on 2022-11-24 GMT+08:00

Obtaining the Labeling Job List of a Dataset

Obtain the labeling job list of a dataset.

dataset.get_label_tasks(is_workforce_task=False, **kwargs)

Sample Code

  • Example 1: Obtain all labeling jobs of a dataset and sort the jobs by creation time in descending order.
    from modelarts.session import Session
    from modelarts.dataset import Dataset
    
    session = Session()
    dataset = Dataset(session,dataset_id="VukxA2FlaTUm7tkDtq0")
    list_label_task_resp = dataset.get_label_tasks(sort_key="create_time", sort_dir="desc")
    print(list_label_task_resp)
  • Example 2: Obtain all team labeling jobs of a dataset.
    list_label_task_resp = dataset.get_label_tasks(is_workforce_task=True)
    print(list_label_task_resp)

Parameters

Table 1 Request parameters

Parameter

Mandatory

Type

Description

is_workforce_task

No

Boolean

Filter criteria, specifying whether to obtain only team labeling jobs

  • True: Only team labeling jobs are obtained.
  • False: Obtain all labeling jobs. This is the default value.

sort_key

No

String

Field for sorting. Options:
  • create_time: Sort jobs by creation time.
  • task_name: Sort jobs by job name.

sort_dir

No

String

Sorting method. Options:

  • asc: Labeling jobs are sorted in ascending order.
  • desc: Labeling jobs are sorted in descending order. This is the default value.