langtest.datahandler.format.QAFormatter#
- class QAFormatter#
Bases:
BaseFormatter
- __init__()#
Methods
__init__
()to_conll
(sample)Converts a custom type to a CoNLL string.
to_csv
(sample)Converts a custom type to a CSV string.
to_jsonl
(*args, **kwargs)Converts a QASample to a JSONL string.
- 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.
- abstract static to_csv(sample: Sample)#
Converts a custom type to a CSV string.
- Parameters:
sample (Sample) – The custom type to convert.
- Returns:
The CSV string representation of the custom type.
- Raises:
NotImplementedError – This method should be implemented by the subclass.
- to_jsonl(*args, **kwargs)#
Converts a QASample to a JSONL string.