:original_name: ListStats.html .. _ListStats: Querying Dataset Statistics =========================== Function -------- This API is used to query dataset statistics. URI --- GET /v2/{project_id}/datasets/{dataset_id}/data-annotations/stats .. table:: **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 the project ID, see :ref:`Obtaining a Project ID `. | +------------+-----------+--------+--------------------------------------------------------------------------------------------------------------------+ .. table:: **Table 2** Query Parameters +--------------+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Mandatory | Type | Description | +==============+===========+========+============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================+ | email | No | String | Email address of a labeling team member. | +--------------+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | locale | No | String | Language. The options are as follows: - **zh-cn**: Chinese - **en-us**: English (default value) | +--------------+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | sample_state | No | String | Query statistics on samples in a specified state. The options are as follows: - **ALL**: labeled - **NONE**: unlabeled - **UNCHECK**: pending acceptance - **ACCEPTED**: accepted - **REJECTED**: rejected - **UNREVIEWED**: pending review - **REVIEWED**: reviewed - **WORKFORCE_SAMPLED**: sampled - **WORKFORCE_SAMPLED_UNCHECK**: sampling unchecked - **WORKFORCE_SAMPLED_CHECKED**: sampling checked - **WORKFORCE_SAMPLED_ACCEPTED**: sampling accepted - **WORKFORCE_SAMPLED_REJECTED**: sampling rejected - **AUTO_ANNOTATION**: to be confirmed | +--------------+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Request Parameters ------------------ None Response Parameters ------------------- **Status code: 200** .. table:: **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. The options are as follows: - **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`>> | Label statistics grouped by labeling type. | +----------------------+------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | hard_detail_stats | Map`> | Statistics on hard example reasons. The type is **Map>**. 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 | Statistics on hard examples. | +----------------------+------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | label_stats | Array of :ref:`LabelStats ` objects | List of label statistics. | +----------------------+------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | metadata_stats | Map | Statistics on sample metadata, in JSON format. | +----------------------+------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | sample_stats | Map | Statistics on sample status. | +----------------------+------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. _liststats__response_labelstats: .. table:: **Table 4** LabelStats +--------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Type | Description | +==============+=============================================================================+========================================================================================================================================================================================================================================================================================================================================================================+ | attributes | Array of :ref:`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 | :ref:`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. The options are as follows: - **0**: image classification - **1**: object detection - **100**: text classification - **101**: named entity recognition - **102**: text triplet relationship - **103**: text triplet entity - **200**: speech classification - **201**: speech content - **202**: speech paragraph labeling - **600**: video classification | +--------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. _liststats__response_labelproperty: .. table:: **Table 5** 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. The options are as follows: - **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. | +--------------------------+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. _liststats__response_pairofintandharddetail: .. table:: **Table 6** PairOfintAndHardDetail +-----------+-----------------------------------------------------------+----------------------------------------------------+ | Parameter | Type | Description | +===========+===========================================================+====================================================+ | key | Integer | Number of times that a hard example reason occurs. | +-----------+-----------------------------------------------------------+----------------------------------------------------+ | value | :ref:`HardDetail ` object | Reason for a hard example. | +-----------+-----------------------------------------------------------+----------------------------------------------------+ .. _liststats__response_harddetail: .. table:: **Table 7** HardDetail ========== ======= ==================== Parameter Type Description ========== ======= ==================== alo_name String Alias. id Integer Reason ID. reason String Reason description. suggestion String Handling suggestion. ========== ======= ==================== .. _liststats__response_labelattribute: .. table:: **Table 8** LabelAttribute +---------------+---------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+ | Parameter | Type | Description | +===============+=======================================================================================+===============================================================================================================+ | default_value | String | Default value of a label attribute. | +---------------+---------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+ | id | String | Label attribute ID. | +---------------+---------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+ | name | String | Label attribute name. | +---------------+---------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+ | type | String | Label attribute type. The options are as follows: - **text**: text - **select**: single-choice drop-down list | +---------------+---------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+ | values | Array of :ref:`LabelAttributeValue ` objects | List of label attribute values. | +---------------+---------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+ .. _liststats__response_labelattributevalue: .. table:: **Table 9** LabelAttributeValue ========= ====== ========================= Parameter Type Description ========= ====== ========================= id String Label attribute value ID. value String Label attribute value. ========= ====== ========================= Example Requests ---------------- Querying Dataset Statistics .. code-block:: text GET https://{endpoint}/v2/{project_id}/datasets/WxCREuCkBSAlQr9xrde/data-annotations/stats Example Responses ----------------- **Status code: 200** OK .. code-block:: { "label_stats" : [ { "name" : "Dog", "type" : 1, "property" : { "@modelarts:color" : "#3399ff" }, "count" : 8, "sample_count" : 5 } ], "sample_stats" : { "un_annotation" : 309, "all" : 317, "total" : 317, "deleted" : 0, "manual_annotation" : 8, "auto_annotation" : 0, "lefted" : 317 }, "key_sample_stats" : { "total" : 317, "non_key_sample" : 315, "key_sample" : 2 }, "deletion_stats" : { }, "metadata_stats" : { }, "data_spliting_enable" : false } Status Codes ------------ =========== ============ Status Code Description =========== ============ 200 OK 401 Unauthorized 403 Forbidden 404 Not Found =========== ============ Error Codes ----------- See :ref:`Error Codes `.