> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/aistore/llms.txt.
> For full documentation content, see https://docs.nvidia.com/aistore/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/aistore/_mcp/server.

# aistore.sdk.dataset.label_attribute

## Module Contents

### Classes

| Name                                                                    | Description                                                                              |
| ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| [`LabelAttribute`](#aistore-sdk-dataset-label_attribute-LabelAttribute) | Defines the labeling attributes for a dataset, mapping filenames to corresponding labels |

### API

```python
class aistore.sdk.dataset.label_attribute.LabelAttribute(
    name: str,
    label_identifier: typing.Callable[[str], str]
)
```

**Bases:** [ConfigAttribute](/python/aistore/sdk/dataset/config_attribute#aistore-sdk-dataset-config_attribute-ConfigAttribute)

Defines the labeling attributes for a dataset, mapping filenames to corresponding labels

**Parameters:**

The name of the attribute, used as a reference and identifier in the dataset

A function that maps a file name to a label

```python
aistore.sdk.dataset.label_attribute.LabelAttribute.get_data_for_entry(
    filename: str
) -> typing.Tuple[str, any]
```

Get the data for a given filename

**Parameters:**

The name of the file to retrieve data for

**Returns:** `Tuple[str, any]`

Tuple\[str, any]: A tuple containing the sample key and the data for the given filename