Repository navigation
Conversation
match_gt2pred_simple marks an unmatched ground truth with pred_idx = "" and a matched one with an integer index. The test `if pred_idx` treats index 0 as unmatched, so the prediction matched at index 0 gets an empty pred_position and pred_category_type. get_order_paired then drops that element from the predicted reading order while keeping it in the ground truth, which penalizes the reading-order edit of correct predictions on every page with tables (the simple matcher handles html_table matching). Compare against "" explicitly, as match_quick.py already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
@dt-yy @ouyanglinke the failing Creating a |
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
match_gt2pred_simple(src/core/matching/match.py) usespred_idx = ""for an unmatched ground truth and an integer for a matched one, then tests it with truthiness:Index
0is falsy, so the prediction matched at index 0 is reported withpred_position = ""andpred_category_type = "".Impact
end2end_dataset.py,match_gt2pred_simple(gt_table, pred_table_candidates, 'html_table', img_name)), and the table matches are fed to the reading-order computation.get_order_pairedkeeps only items withpred_position != ""on the prediction side, but keeps every ground-truth position. The first matched table is therefore removed from the predicted order and counted as a deletion.pred/norm_pred, which are set correctly).match_quick.pyalready compares explicitly (if entry['pred_idx'] != [""] else "").Reproduction
Two ground-truth tables, two predictions with identical content in the same order:
On
main(f133a71):With this PR:
A perfect prediction scores a reading-order edit of 0.5 instead of 0.0. With a single table on the page, the table is always dropped.
Fix
Compare with
""explicitly (two lines). No other behavior changes: unmatched items still get"".🤖 Generated with Claude Code