Skip to content

[Bugfix] Preserve valid HTML attributes in CCOCR table evaluation - #1609

Open
Sun-Jiatuhao wants to merge 1 commit into
open-compass:mainfrom
Sun-Jiatuhao:fix/ccocr-table-html-evaluator
Open

[Bugfix] Preserve valid HTML attributes in CCOCR table evaluation#1609
Sun-Jiatuhao wants to merge 1 commit into
open-compass:mainfrom
Sun-Jiatuhao:fix/ccocr-table-html-evaluator

Conversation

@Sun-Jiatuhao

Copy link
Copy Markdown

Summary

This PR fixes abnormally low CCOCR table parsing scores for model outputs containing valid HTML table attributes or Markdown code fences.

Some otherwise correct table outputs, such as tables containing border, colspan, or rowspan attributes, could receive unexpectedly low or zero scores during evaluation.

Changes

  • Preserve valid HTML tag and attribute syntax during preprocessing.
  • Extract HTML tables from Markdown fences and surrounding response text.
  • Normalize whitespace in text nodes without modifying HTML syntax.
  • Treat th elements as table cells during TEDS evaluation.
  • Handle malformed or missing tables safely.
  • Add regression tests for the affected output patterns.

Tests

python -m unittest -v tests/test_ccocr_table_evaluator.py

All 4 tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant