primeqa.mrc.metrics.tydi_f1.eval_utils.Span#

class primeqa.mrc.metrics.tydi_f1.eval_utils.Span(start_byte_offset, end_byte_offset)#

Bases: object

A class for handling token and byte spans.

The logic is:

  1. if both start_byte != -1 and end_byte != -1 then the span is defined by byte offsets

  1. else, this is a null span.

Null spans means that there is no (passage or minimal) answers.

Methods

is_null_span

A span is a null span if the start and end are both -1.

is_null_span()#

A span is a null span if the start and end are both -1.

This can happen for both gold and predicted values and for both passage answers and minimal answers.

Returns

boolean flag whether it is null span or not.