bibraeval.FieldMetric

class bibraeval.FieldMetric(list_comparison='all-of')

Bases: object

Base class for scalar and list-valued field agreement metrics.

Subclasses implement scalar scoring and list alignment. all-of scores aligned list entries using precision/recall/F1; any-of returns the best scalar agreement among aligned entries.

Parameters:

list_comparison (Literal['all-of', 'any-of'])

score(gt_value, predicted_value)

Compute agreement for a scalar pair or two lists of values.

Parameters:
  • gt_value (Any) – Field value in the gold-standard record.

  • predicted_value (Any) – Field value in the predicted record.

Returns:

A score between 0 and 1. Missing-value presence policy is handled separately by Aggregator; direct calls score values according to the selected metric.

Return type:

float