nlptest.datahandler.datasource.CSVDataset#

class CSVDataset(file_path: str, task: str)#

Bases: _IDataset

Class to handle CSV files dataset. Subclass of _IDataset.

__init__(file_path: str, task: str) None#

Initializes CSVDataset object. :param file_path: Path to the data file. :type file_path: str :param task: Task to be evaluated. :type task: str

Methods

__init__(file_path, task)

Initializes CSVDataset object.

export_data(data, output_path)

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

load_data()

Loads data from a csv file.

Attributes

COLUMN_NAMES

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

Exports the data to the corresponding format and saves it to ‘output_path’. :param data: data to export :type data: List[Sample] :param output_path: path to save the data to :type output_path: str

load_data() List[Sample]#

Loads data from a csv file. :returns: List of formatted sentences from the dataset. :rtype: List[Sample]