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(custom_type)

Converts a custom type to a CoNLL string.

to_csv(sample[, delimiter])

param sample:

The input sample containing the SequenceClassificationOutput object to convert.

abstract static to_conll(custom_type)#

Converts a custom type to a CoNLL string.

Parameters:

custom_type – 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: Sample, delimiter: str = ',') str#
Parameters:
  • sample (Sample) – The input sample containing the SequenceClassificationOutput object to convert.

  • delimiter (str) – The delimiter character to use in the CSV string.

Returns:

The CSV string representation of the SequenceClassificationOutput object.

Return type:

str