fix(metrics): compute TEDS over the actual ordered tree - #77
Closed
lanyue-llk wants to merge 2 commits into
Closed
lanyue-llk wants to merge 2 commits into
lanyue-llk wants to merge 2 commits into
Conversation
Author
|
Closing this upstream submission. The correction is maintained in the lexmount fork at lexmount#1. |
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.
Root cause
TEDSMetric._tree_edit_distanceserializes each parsed table tree into a string and passes that string directly toAPTED. The defaultConfig.childrenaccessor does not parse the serialization, so APTED sees each whole table as one leaf. Nested row and cell differences are therefore not evaluated.The exception fallback also returns only the absolute node count difference. Equal-size trees with different structure can consequently receive an optimistic distance of zero.
Fix
TableConfig.childrenhow to traverse theirchildrenarrays;Verification
tests/test_teds.py: 24 tests passed.torch; the test file was run in the locked browser-eval environment with the metric package loaded directly, so the TEDS suite itself ran without installing the unrelated LLM extractor dependency.This changes scorer output. Existing published benchmark evidence should retain its pinned scorer commit and original values; future benchmark profiles can pin the fixed commit explicitly.