Skip to content

[metrics] Return an F1 of 0 in TableCellMetric when no cell matches - #2192

Merged
felixdittrich92 merged 1 commit into
mindee:mainfrom
RavSinghChandan:table-metric-f1-no-match
Oct 30, 2026
Merged

felixdittrich92 merged 1 commit into
mindee:mainfrom
RavSinghChandan:table-metric-f1-no-match

Conversation

@RavSinghChandan

Copy link
Copy Markdown
Contributor

When there are ground-truth and predicted cells but none of them match, TableCellMetric.summary() returned a recall and a precision of 0, but an F1 of None. references/table/train.py then logged "Undefined metric value, caused by empty GTs or predictions" for such an epoch, although neither was empty.

The F1 is now 0 in that case, and stays None only when the recall or the precision is undefined (no ground truth or no prediction)

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.75%. Comparing base (9ae237d) to head (0ab09c9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2192   +/-   ##
=======================================
  Coverage   97.75%   97.75%           
=======================================
  Files         170      170           
  Lines       10959    10961    +2     
=======================================
+ Hits        10713    10715    +2     
  Misses        246      246           
Flag Coverage Δ
unittests 97.75% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@felixdittrich92 felixdittrich92 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @RavSinghChandan 👍

@felixdittrich92 felixdittrich92 self-assigned this Oct 30, 2026
@felixdittrich92 felixdittrich92 added this to the 1.2.0 milestone Oct 30, 2026
@felixdittrich92 felixdittrich92 added type: bug Something isn't working module: utils Related to doctr.utils ext: tests Related to tests folder topic: table comprehension Related to table comprehension labels Oct 30, 2026
@felixdittrich92
felixdittrich92 merged commit b14dd36 into mindee:main Oct 30, 2026
56 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext: tests Related to tests folder module: utils Related to doctr.utils topic: table comprehension Related to table comprehension type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants