Skip to content

Add token-level recall metric (get_metric_recall_default_prep) - #4

Merged
simon-ging merged 1 commit into
lmb-freiburg:mainfrom
yusufSLCN:add-recall-metric
Jun 16, 2026
Merged

Add token-level recall metric (get_metric_recall_default_prep)#4
simon-ging merged 1 commit into
lmb-freiburg:mainfrom
yusufSLCN:add-recall-metric

Conversation

@yusufSLCN

Copy link
Copy Markdown
Contributor

Add a token-level recall metric

This adds get_metric_recall_default_prep() and a compare_recall comparison
function to ovqa/metrics/simple.py, mirroring the existing
get_f1_score_default_prep() / compare_f1.

compare_recall reuses transformers' SQuAD get_tokens (already used by
compute_f1) and returns the recall component of the token overlap — the
fraction of reference tokens that also appear in the candidate — with the same
empty-string edge-case handling as the SQuAD F1.

Why

Report / VQA evaluations often report recall alongside F1 and accuracy, but OVQA
only exposes F1 and exact/contains comparisons. This is a small, dependency-free
addition consistent with the existing metric factories.

Notes

  • No new dependencies (collections is stdlib; get_tokens comes from the same
    transformers.data.metrics.squad_metrics module already imported for F1).
  • No changes to existing behaviour.

Adds compare_recall and a get_metric_recall_default_prep() factory mirroring
the existing F1 metric, exposing the recall component of the SQuAD-style
token overlap. Useful for report/VQA evaluation where recall is reported
alongside F1 and accuracy.
@simon-ging
simon-ging merged commit 67e0673 into lmb-freiburg:main Jun 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants