langtest.datahandler.format.SequenceClassificationOutputFormatter#

class SequenceClassificationOutputFormatter#

Bases: BaseFormatter, ABC

Formatter class for converting SequenceClassificationOutput objects to CSV.

The to_csv method returns a CSV string representing the SequenceClassificationOutput object in the sample argument.

__init__()#

Methods

__init__()

to_conll(sample)

Converts a custom type to a CoNLL string.

to_csv(sample)

Convert a SequenceClassificationSample object into a row for exporting.

abstract static to_conll(sample: Sample)#

Converts a custom type to a CoNLL string.

Parameters:

sample (Sample) – The custom type to convert.

Returns:

The CoNLL string representation of the custom type.

Raises:

NotImplementedError – This method should be implemented by the subclass.

static to_csv(sample: SequenceClassificationSample) Tuple[str, str]#

Convert a SequenceClassificationSample object into a row for exporting.

Parameters:

sample (SequenceClassificationSample) – Sample object to convert.

Returns:

Row formatted as a list of strings.

Return type:

Tuple[str, str]