Help Center> ModelArts> API Reference> Historical APIs> Data Management (Old Version)> Querying Details About Team Labeling Task Statistics
Updated on 2024-05-30 GMT+08:00

Querying Details About Team Labeling Task Statistics

Function

This API is used to query details about team labeling task statistics.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v2/{project_id}/datasets/{dataset_id}/workforce-tasks/{workforce_task_id}/data-annotations/stats

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

dataset_id

Yes

String

Dataset ID.

project_id

Yes

String

Project ID. For details about how to obtain a project ID, see Obtaining a Project ID and Name.

workforce_task_id

Yes

String

ID of a team labeling task.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

sample_state

No

String

Statistics on the specified sample state. The options are as follows:

  • __ALL__: labeled

  • __NONE__: not marked

  • __UNCHECK__: to be accepted

  • __ACCEPTED__: The acceptance is passed.

  • __REJECTED__: rejected

  • __UNREVIEWED__: to be reviewed

  • __REVIEWED__: approved

  • __WORKFORCE_SAMPLED__: sampled

  • __WORKFORCE_SAMPLED_UNCHECK__: Sampling is to be accepted.

  • __WORKFORCE_SAMPLED_CHECKED__: Sampling has been accepted.

  • __WORKFORCE_SAMPLED_ACCEPTED__: The sampling is passed.

  • __WORKFORCE_SAMPLED_REJECTED__: The sampling has been rejected.

  • __AUTO_ANNOTATION__: to be confirmed

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

data_path

String

Path for storing data of a dataset.

data_spliting_enable

Boolean

Whether the dataset can be split into training set and validation set based on the sample labeling statistics. Options:

  • true: The dataset can be split into training set and validation set.

  • false: The dataset cannot be split into training set and validation set.

grouped_label_stats

Map<String,Array<LabelStats>>

Label statistics grouped by labeling type.

hard_detail_stats

Map<String,PairOfintAndHardDetail>

Statistics on hard example reasons. The type is Map<Integer, Pair<Integer, HardDetail>>. The key of Map indicates the ID of the hard example reason, the key of Pair indicates the number of times that the hard example reason occurs, and the value of Pair indicates the hard example reason.

key_sample_stats

Map<String,Integer>

Statistics on hard examples.

label_stats

Array of LabelStats objects

List of label statistics.

metadata_stats

Map<String,Object>

Statistics on sample metadata, in JSON format.

sample_stats

Map<String,Integer>

Statistics on sample status.

Table 4 LabelStats

Parameter

Type

Description

attributes

Array of LabelAttribute objects

Multi-dimensional attribute of a label. For example, if the label is music, attributes such as style and artist may be included.

count

Integer

Number of labels.

name

String

Label name.

property

LabelProperty object

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

sample_count

Integer

Number of samples containing the label.

type

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 5 PairOfintAndHardDetail

Parameter

Type

Description

key

Integer

Number of times that a hard example reason occurs.

value

HardDetail object

Reason for a hard example.

Table 6 HardDetail

Parameter

Type

Description

alo_name

String

Alias.

id

Integer

Reason ID.

reason

String

Reason description.

suggestion

String

Handling suggestion.

Table 7 LabelAttribute

Parameter

Type

Description

default_value

String

Default value of a label attribute.

id

String

Label attribute ID. You can query the tag by invoking the tag list.

name

String

Label attribute name. The value contains a maximum of 64 characters and cannot contain the character. <>=&"'.

type

String

Label attribute type. Options:

  • text: text

  • select: single-choice drop-down list

values

Array of LabelAttributeValue objects

List of label attribute values.

Table 8 LabelAttributeValue

Parameter

Type

Description

id

String

Label attribute value ID.

value

String

Label attribute value.

Table 9 LabelProperty

Parameter

Type

Description

@modelarts:color

String

Default attribute: Label color, which is a hexadecimal code of the color. By default, this parameter is left blank. Example: #FFFFF0.

@modelarts:default_shape

String

Default attribute: 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: dotted line

  • point: point

  • polyline: polyline

@modelarts:from_type

String

Default attribute: 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

String

Default attribute: The new name of the label.

@modelarts:shortcut

String

Default attribute: Label shortcut key. By default, this parameter is left blank. For example: D.

@modelarts:to_type

String

Default attribute: 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.

Example Requests

Querying Statistics on Unapproved Samples of a Team Labeling Task

GET https://{endpoint}/v2/{project_id}/datasets/WxCREuCkBSAlQr9xrde/workforce-tasks/tY330MHxV9dqIPVaTRM/data-annotations/stats?sample_state=__unreviewed__

Example Responses

Status code: 200

OK

{
  "label_stats" : [ {
    "name" : "Rabbits",
    "type" : 1,
    "property" : {
      "@modelarts:color" : "#3399ff"
    },
    "count" : 0,
    "sample_count" : 0
  }, {
    "name" : "Bees",
    "type" : 1,
    "property" : {
      "@modelarts:color" : "#3399ff"
    },
    "count" : 1,
    "sample_count" : 1
  } ],
  "sample_stats" : {
    "un_annotation" : 308,
    "total" : 309,
    "rejected" : 0,
    "unreviewed" : 1,
    "accepted" : 0,
    "auto_annotation" : 0,
    "uncheck" : 0
  },
  "key_sample_stats" : {
    "total" : 309,
    "non_key_sample" : 309,
    "key_sample" : 0
  },
  "metadata_stats" : { },
  "data_spliting_enable" : false
}

Status Codes

Status Code

Description

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.