primeqa.mrc.metrics.nq_f1.nq_eval.compute_pr_curves#

primeqa.mrc.metrics.nq_f1.nq_eval.compute_pr_curves(answer_stats, targets: Optional[List] = None)#

Computes PR curve and returns R@P for specific targets.

The values are computed as follows: find the (precision, recall) point with maximum recall and where precision > target.

Parameters
  • answer_stats – List of statistic tuples from the answer scores.

  • targets (None) – List of precision thresholds to target.

Returns

[target, r, p, score].

Return type

List of table with rows