sighan#

class DetectionF1(pos_label=1, name='DetectionF1', *args, **kwargs)[source]#

Bases: Metric

update(preds, labels, length, *args)[source]#

Update states for metric

Inputs of update is the outputs of Metric.compute, if compute is not defined, the inputs of update will be flatten arguments of output of mode and label from data: update(output1, output2, ..., label1, label2,...)

see Metric.compute

reset()[source]#

Resets all of the metric state.

accumulate()[source]#

Accumulates statistics, computes and returns the metric value

name()[source]#

Returns name of the metric instance.

Returns:

The name of the metric instance.

Return type:

str

class CorrectionF1(pos_label=1, name='CorrectionF1', *args, **kwargs)[source]#

Bases: DetectionF1

update(det_preds, det_labels, corr_preds, corr_labels, length, *args)[source]#

Update states for metric

Inputs of update is the outputs of Metric.compute, if compute is not defined, the inputs of update will be flatten arguments of output of mode and label from data: update(output1, output2, ..., label1, label2,...)

see Metric.compute