Skip to content

Module redlite.dataset.json_dataset

Classes

JSONDataset

class JSONDataset(
    *,
    path: str,
    name: str,
    split: Literal['test', 'train'],
    labels: dict[str, str] | None = None
)

Dataset from a local JSONL file.

Each line of the dataset file must be a DatasetItem serialized to JSON representation. File must use UTF-8 encoding. There should be no BOM-markers (some Microsoft tools produce those).

  • path (str): Location of JSONL file.
  • name (str): Dataset name.
  • split (str): Dataset split.
  • labels (dict[str, str]): Labels.

Ancestors (in MRO)

  • redlite.dataset.memory_dataset.MemoryDataset
  • redlite.dataset._load.ValidatingDataset
  • redlite._core.NamedDataset
  • collections.abc.Sized
  • collections.abc.Iterable