langtest.datahandler.datasource.ConllDataset#

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

Bases: _IDataset

Class to handle Conll files. Subclass of _IDataset.

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

Initializes ConllDataset object. :param file_path: Path to the data file. :type file_path: str

Methods

__init__(file_path, task)

Initializes ConllDataset 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 CoNLL file.

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[NERSample]#

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