Expand description
The splits of a Hugging Face datasets directory.
A cache directory holds a file per split, name-train.arrow, or a split’s shards,
name-train-00000-of-00003.arrow, beside dataset_info.json. A save_to_disk
DatasetDict holds a subdirectory per split, named in its dataset_dict.json. The
splits are separate tables: an open reads one, train unless --table names
another, and lists the rest. map() writes its results beside a cache’s splits as
cache-*.arrow, with columns of their own, so those are left out and counted.
Structs§
- Splits
- What an open of a cache directory chose, and what it left out.
Constants§
- DATASET_
DICT - The file that marks a DatasetDict directory.
Functions§
- cache_
splits - The splits a cache directory’s Arrow files name, in the order an open offers them, as the home screen lists them inside it. Empty for any other directory, and for one whose files name no splits. Its listing is all that is read.
- choose
- Which of
names, a cache directory’s Arrow files, an open reads: the files of the splitpickchooses, the others by name after the threedatasetsnames itself. Indices intonames, in its order. - dataset_
dict - The splits a
save_to_diskDatasetDict directory names in itsdataset_dict.json, in its order, each a subdirectory ofdir.Nonefor any other directory. - dict_
splits - The split names of a
dataset_dict.json:{"splits": ["train", "test"]}. Each is a directory’s name, so one that could name another place is refused. - is_
cache - Whether
nameis a filemap()wrote rather than a split’s. - is_
cache_ dir - Whether
diris adatasetscache directory: its metadata beside Arrow files. - pick
- The split of
listedan open reads,tableif given, else the first in offered order, and the others in that order:train,validationandtest, then the rest as listed. - split_
of - The split a cache file’s name says it holds:
trainforpeople-train.arrowandpeople-train-00001-of-00002.arrow. Split names are word characters and dots. - split_
place - The cache directory and the split a path inside one names (
cache/test), as the home screen lists it and recents record it.Nonefor a path that is there.