aistore.sdk.dataset.label_attribute

View as MarkdownOpen in Claude

Module Contents

Classes

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

API

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

Bases: ConfigAttribute

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

Parameters:

name
str

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

label_identifier
Callable[[str], str]

A function that maps a file name to a label

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

Get the data for a given filename

Parameters:

filename
str

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