Skip to content

scoring: add missing-table-caption diagnostic with evidence - #29

Open
qiaobochi040726-source wants to merge 1 commit into
zxyasfas:mainfrom
qiaobochi040726-source:20260806-table-caption-diagnostics
Open

scoring: add missing-table-caption diagnostic with evidence#29
qiaobochi040726-source wants to merge 1 commit into
zxyasfas:mainfrom
qiaobochi040726-source:20260806-table-caption-diagnostics

Conversation

@qiaobochi040726-source

Copy link
Copy Markdown

Fixes #13

新增 missing_table_caption 诊断:表格正上方最近的非空段落不是表格题注时触发,证据含表格序号、段落索引与文本片段,用户可直接定位。

  • paper_format_agent/scorer.py:按 docx XML body 的 w:p/w:tbl 实际顺序遍历(不丢失段落与表格的交错关系),_table_caption_evidence() 就近向上找非空段落并用 is_table_caption 判断;罚分 min(20, n*6);catalog 条目 severity=medium + 可执行 suggested_fix
  • tests/test_scorer_diagnostics.py:合成失败用例(无题注表格 → 诊断发出 + 罚分 + 证据)+ 负向用例(带题注不触发,带题注文档分数更高)

验证:pytest 63 passed(基线 61+2);validate_skill / compile_check OK。遗留:题注编号格式(表 1 vs Table 1)与样式(居中/加粗)可作后续独立诊断;对隔空段落较宽松以减少误报。

Introduce a focused scoring check that detects tables whose nearest
preceding non-empty paragraph is not a table caption. Emits a
medium-severity diagnostic with per-table evidence (table index, preceding
paragraph index and text) and a suggested_fix, penalizing min(20, n*6)
points. Adds a synthetic failing case and a negative case. Closes zxyasfas#13.
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.

Help wanted: add table caption diagnostics

1 participant