fix(metrics): compute occurrence-based ROUGE recall fallback - #288
Conversation
The ROUGE fallback documented itself as unigram recall but deduplicated both sides into sets, so repetition in the reference was ignored and a term repeated many times counted once. Use a Counter intersection over the reference's total token count so recall is sensitive to how many occurrences are recovered. Fixes OpenAgentHQ#282
|
/oc review pr |
Review SummaryApprove. The fix correctly addresses #282. The bugThe fallback documented itself as "simple unigram recall" but converted both sides to The fix
Verification
Tests
Couldn't run Nits (non-blocking): none material. The fallback is now stricter than the HF path (which returns F1), but that divergence is pre-existing and out of scope. Recommendation: merge. |
|
🎉 Congratulations @Nithyaviswak! Your pull request has been successfully merged into main. 🚀 Thank you for contributing to OpenAgentHQ and helping improve the project. We truly appreciate your contribution and hope to see you back with more amazing PRs! Happy Open Sourcing! ❤️ 🌟 This is your first merged contribution to this repository. |

The ROUGE fallback documented itself as unigram recall but deduplicated both sides into sets, so repetition in the reference was ignored and a term repeated many times counted once. Use a Counter intersection over the reference's total token count so recall is sensitive to how many occurrences are recovered.
Fixes #282
Description
A clear and concise description of what this PR does.
Type of Change
Related Issues
Closes #(issue_number)
How Has This Been Tested?
Describe the tests that you ran to verify your changes.
uv run pytest)uv run ruff check .)uv run mypy openagent_eval/)Checklist
Screenshots (if applicable)
Add screenshots to demonstrate visual changes.
Additional Notes
Add any other notes about the PR here.