:original_name: UpdateDataset.html .. _UpdateDataset: Modifying a Dataset =================== Function -------- This API is used to modify basic information about a dataset, such as the dataset name, description, current version, and labels. URI --- PUT /v2/{project_id}/datasets/{dataset_id} .. 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 `. | +------------+-----------+--------+--------------------------------------------------------------------------------------------------------------------+ Request Parameters ------------------ .. table:: **Table 2** Request body parameters +--------------------+-----------+--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Mandatory | Type | Description | +====================+===========+==============================================================+=================================================================================================================================+ | add_labels | No | Array of :ref:`Label ` objects | List of added labels. | +--------------------+-----------+--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | current_version_id | No | String | ID of current dataset version. | +--------------------+-----------+--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | dataset_name | No | String | Dataset name. | +--------------------+-----------+--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | delete_labels | No | Array of :ref:`Label ` objects | List of deleted labels. | +--------------------+-----------+--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | description | No | String | Dataset description. The value contains 0 to 256 characters and does not support the following special characters: ``^!<>=&"'`` | +--------------------+-----------+--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | update_labels | No | Array of :ref:`Label ` objects | List of updated labels. | +--------------------+-----------+--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ .. _updatedataset__request_label: .. table:: **Table 3** Label +-----------------+-----------------+--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Mandatory | Type | Description | +=================+=================+================================================================================+==================================================================================================================================+ | attributes | No | 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. | +-----------------+-----------------+--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | name | No | String | Label name. | +-----------------+-----------------+--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | property | No | :ref:`LabelProperty ` object | Basic attribute key-value pair of a label, such as color and shortcut keys. | +-----------------+-----------------+--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | type | No | 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 | +-----------------+-----------------+--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ .. _updatedataset__request_labelattribute: .. table:: **Table 4** LabelAttribute +-----------------+-----------------+------------------------------------------------------------------------------------------+---------------------------------------------------+ | Parameter | Mandatory | Type | Description | +=================+=================+==========================================================================================+===================================================+ | default_value | No | String | Default value of a label attribute. | +-----------------+-----------------+------------------------------------------------------------------------------------------+---------------------------------------------------+ | id | No | String | Label attribute ID. | +-----------------+-----------------+------------------------------------------------------------------------------------------+---------------------------------------------------+ | name | No | String | Label attribute name. | +-----------------+-----------------+------------------------------------------------------------------------------------------+---------------------------------------------------+ | type | No | String | Label attribute type. The options are as follows: | | | | | | | | | | - **text**: text | | | | | | | | | | - **select**: single-choice drop-down list | +-----------------+-----------------+------------------------------------------------------------------------------------------+---------------------------------------------------+ | values | No | Array of :ref:`LabelAttributeValue ` objects | List of label attribute values. | +-----------------+-----------------+------------------------------------------------------------------------------------------+---------------------------------------------------+ .. _updatedataset__request_labelattributevalue: .. table:: **Table 5** LabelAttributeValue ========= ========= ====== ========================= Parameter Mandatory Type Description ========= ========= ====== ========================= id No String Label attribute value ID. value No String Label attribute value. ========= ========= ====== ========================= .. _updatedataset__request_labelproperty: .. table:: **Table 6** LabelProperty +--------------------------+-----------------+-----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Mandatory | Type | Description | +==========================+=================+=================+================================================================================================================================================================================================================+ | @modelarts:color | No | 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 | No | 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 | No | 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 | No | String | Default attribute: The new name of the label. | +--------------------------+-----------------+-----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | @modelarts:shortcut | No | String | Default attribute: Label shortcut key. By default, this parameter is left blank. For example: **D**. | +--------------------------+-----------------+-----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | @modelarts:to_type | No | 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. | +--------------------------+-----------------+-----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Response Parameters ------------------- **Status code: 200** .. table:: **Table 7** Response body parameters ========== ====== =========== Parameter Type Description ========== ====== =========== dataset_id String Dataset ID. ========== ====== =========== Example Requests ---------------- Modifying a Dataset .. code-block:: { "dataset_id" : "gfghHSokody6AJigS5A", "description" : "just a test", "add_tags" : [ { "name" : "Pig", "type" : 0, "property" : { "@modelarts:color" : "#3399ff" } } ] } Example Responses ----------------- **Status code: 200** OK .. code-block:: { "dataset_id" : "gfghHSokody6AJigS5A" } Status Codes ------------ =========== ============ Status Code Description =========== ============ 200 OK 401 Unauthorized 403 Forbidden 404 Not Found =========== ============ Error Codes ----------- See :ref:`Error Codes `.