eval_utils#

Utility function for TyDi QA evaluation.

Functions

compute_partial_match_scores

Compute byte indices precision, recall and F1 score between span a and b.

gold_has_minimal_answer

Gets vote from annotators for judging if there is a minimal answer.

gold_has_passage_answer

Gets vote from annotators for judging if there is a passage answer.

nonnull_span_equal

Given two spans, return if they are equal.

safe_average

Computes average elements, but returns 0 if elements is empty.

safe_divide

Compute x / y, but return 0 if y is zero.

Classes

Span

A class for handling token and byte spans.

TyDiLabel