Repository navigation
fix(pubmedqa): include unrecognized answers in recall and F1 denominators - #1828
Merged
Yunnglin merged 1 commit intoOct 10, 2026
Merged
Conversation
Yunnglin
approved these changes
Oct 10, 2026
Yunnglin
left a comment
Collaborator
There was a problem hiding this comment.
LGTM — verified locally that the recall-denominator fix is correct (unrecognized answers now stay false negatives, precision untouched), the 9 regression tests pass, and reverting the one-line act_pos change reproduces the reported 5 fail / 4 pass; thanks for the thorough reproduction and the v1.1 bump!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and change
PubMedQA drops unrecognized answers from its confusion matrix, then uses the matrix row sums as the recall denominators. This silently inflates macro recall/F1. In the reproduction in #1827, a model answering 24 of 30 cases correctly and abstaining on six receives F1 1.0, incorrectly ranking ahead of a model scoring 0.9.
Count ground-truth class support independently of recognized predictions, so abstentions remain false negatives. The first model's F1 becomes 0.888889 and recall becomes 0.8; accuracy and the other model's scores are unchanged. Preserve the existing three-class macro averaging and answer parsing. Bump PubMedQA's evaluation version to v1.1 for the changed scoring semantics.
Fixes #1827.
Validation
make lint: passed.pytest tests/cli/test_all.py::TestRun::test_ci_lite -v -s -p no:warnings: passed using the mock model (no.envfile/API key).