fix: page-1 metadata sidebar labels should be frontmatter_noise not section_heading

'INFORMACIÓN DEL ARTÍCULO' (Article Information) is a left-column metadata
panel label, not a section heading. Previously defaulted to section_heading
at line 1243 ('unnumbered paragraph_title on page 1 outside title zone').

Structural-guard approach: only trigger text matching when the block is
narrow (< 35% page width) AND in the left column (x_center < 50% page
width). This prevents false matches on full-width body text or right-column
headings containing similar words.
This commit is contained in:
Research Assistant 2026-06-28 22:06:51 +08:00
parent 68e0699b64
commit 51d3d3d114

View file

@ -1051,6 +1051,25 @@ def assign_block_role(
confidence=0.9,
evidence=[f"frontmatter noise: {text[:60]}"],
)
# Page-1 metadata sidebar labels ("INFORMACIÓN DEL ARTÍCULO", "Article Info")
# are frontmatter_noise, not section headings. They layout the metadata
# panel (article history, keywords, correspondence) not the paper's sections.
# Structural guard: only applies if the block is narrow + in the left column,
# preventing false matches on full-width or right-column content.
if (block.get("page") or 1) == 1:
_bbox = block.get("block_bbox") or block.get("bbox") or [0, 0, 0, 0]
if len(_bbox) >= 4:
_bw = _bbox[2] - _bbox[0]
_pw = float(block.get("page_width") or page_width or 1200)
_xc = (_bbox[0] + _bbox[2]) / 2
if _bw < _pw * 0.35 and _xc < _pw * 0.5:
if lower in {"información del artículo", "article info", "article information",
"informations sur l'article", "artikel information"}:
return RoleAssignment(
role="frontmatter_noise",
confidence=0.85,
evidence=[f"page-1 metadata sidebar label: {text[:60]}"],
)
if lower == "abstract":
return RoleAssignment(
role="abstract_heading",