From 51d3d3d1146e6535c0a8b252f20f83cb92e4bdf6 Mon Sep 17 00:00:00 2001 From: Research Assistant Date: Sun, 28 Jun 2026 22:06:51 +0800 Subject: [PATCH] fix: page-1 metadata sidebar labels should be frontmatter_noise not section_heading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit '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. --- paperforge/worker/ocr_roles.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/paperforge/worker/ocr_roles.py b/paperforge/worker/ocr_roles.py index 65f94e8b..d550de00 100644 --- a/paperforge/worker/ocr_roles.py +++ b/paperforge/worker/ocr_roles.py @@ -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",