sighan#

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

基类:Metric

update(preds, labels, length, *args)[源代码]#

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()[源代码]#

Resets all of the metric state.

accumulate()[源代码]#

Accumulates statistics, computes and returns the metric value

name()[源代码]#

Returns name of the metric instance.

返回:

The name of the metric instance.

返回类型:

str

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

基类:DetectionF1

update(det_preds, det_labels, corr_preds, corr_labels, length, *args)[源代码]#

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