tfds.testing.dummy_croissant_file
Stay organized with collections
Save and categorize content based on your preferences.
Yields temporary path to a dummy Croissant file.
@contextlib.contextmanager
tfds.testing.dummy_croissant_file(
dataset_name: str = 'DummyDataset',
entries: (Sequence[dict[str, Any]] | None) = None,
raw_data_filename: epath.PathLike = 'raw_data.jsonl',
croissant_filename: epath.PathLike = 'croissant.json',
split_names: (Sequence[str] | None) = None,
version: str = '1.2.0'
) -> Iterator[epath.Path]
The function creates a temporary directory that stores raw data files and the
Croissant JSON-LD.
Args |
dataset_name
|
The name of the dataset.
|
entries
|
A list of dictionaries representing the dataset's entries. Each
dictionary should contain an 'index', a 'text', and a split key. If
None, the function will create two entries with indices 0 and 1 and dummy
text, and with the first entry belonging to the split train and the
second to test.
|
raw_data_filename
|
Filename of the raw data file. If split_names is True,
the function will create a raw data file for each split, including the
split name before the file extension.
|
croissant_filename
|
Filename of the Croissant JSON-LD file.
|
split_names
|
A list of split names to populate the split record set with. If
split_names are defined, they must match the split key in the entries.
If None, the function will create a split record set with the default
split names train and test. If split_names is defined, the split
key in the entries must match one of the split names.
|
version
|
The version of the dataset. Defaults to 1.2.0.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-10-31 UTC."],[],[]]