set_metadata
code_loader.leap_binder.set_ground_truth
The
leap_binder.set_metadata
binding function points to Metadata Function. In addition, it defines the metadata_type
and name
for reference.code_loader.leap_binder.set_metadata(
function=MetadataSectionCallableInterface,
metadata_type=DatasetMetadataType,
name=str
)
Args | Text |
---|---|
function | |
metadata_type |
|
name | (str) with the given name of the input, e.g. image. |
from code_loader import leap_binder
from code_loader.contract.datasetclasses import PreprocessResponse
...
def metadata_label(idx: int, subset: Union[PreprocessResponse, list]) -> str:
return subset.data.iloc[idx]['label']
leap_binder.set_metadata(
function=metadata_label,
metadata_type=DatasetMetadataType.str,
name='label'
)
Full examples can be found at the Dataset Integration section of the following guides:
Last modified 8mo ago