langtest.datahandler.datasource.JSONDataset#

class JSONDataset(file_path: str)#

Bases: BaseDataset

Class to handle JSON dataset files. Subclass of BaseDataset.

__init__(file_path: str)#

Initializes JSONDataset object.

Parameters:

file_path (str) – Path to the data file.

Methods

__init__(file_path)

Initializes JSONDataset object.

export_data(data, output_path)

Exports the data to the corresponding format and saves it to 'output_path'.

load_data()

Loads data into a list of Sample

load_raw_data()

Loads data into a raw list

Attributes

data_sources

export_data(data: List[Sample], output_path: str)#

Exports the data to the corresponding format and saves it to ‘output_path’.

Parameters:
  • data (List[Sample]) – data to export

  • output_path (str) – path to save the data to

load_data() List[Sample]#

Loads data into a list of Sample

Returns:

formatted samples

Return type:

List[Sample]

load_raw_data()#

Loads data into a raw list