Skip to content

squad_em_and_f1

SquadEmAndF1#

class SquadEmAndF1(Metric):
 | def __init__(self) -> None

This Metric takes the best span string computed by a model, along with the answer strings labeled in the data, and computed exact match and F1 score using the official SQuAD evaluation script.

__call__#

class SquadEmAndF1(Metric):
 | ...
 | @overrides
 | def __call__(self, best_span_string, answer_strings)

Parametersvalue : float

The value to average.

get_metric#

class SquadEmAndF1(Metric):
 | ...
 | @overrides
 | def get_metric(self, reset: bool = False) -> Tuple[float, float]

ReturnsAverage exact match and F1 score (in that order) as computed by the official SQuAD script

over all inputs.

reset#

class SquadEmAndF1(Metric):
 | ...
 | @overrides
 | def reset(self)