{"record":{"id":"6443acc1d02b3ea5","repo":"opendatalab/MinerU","slug":"unsupported-pp-doclayoutv2-label-label","errorCode":null,"errorMessage":"Unsupported PP-DocLayoutV2 label: {label}","messagePattern":"Unsupported PP-DocLayoutV2 label: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mineru/model/layout/pp_doclayoutv2.py","lineNumber":1190,"sourceCode":"    def _is_inline_formula_box(box: Dict) -> bool:\n        return box.get(\"label\") == \"inline_formula\" or int(box.get(\"cls_id\", -1)) == 15\n\n    @staticmethod\n    def _is_formula_box(box: Dict) -> bool:\n        return (\n            PPDocLayoutV2LayoutModel._is_display_formula_box(box)\n            or PPDocLayoutV2LayoutModel._is_inline_formula_box(box)\n        )\n\n    @staticmethod\n    def _is_formula_number_box(box: Dict) -> bool:\n        return box.get(\"label\") == \"formula_number\" or int(box.get(\"cls_id\", -1)) == 11\n\n    @staticmethod\n    def _set_box_label(box: Dict, label: str) -> None:\n        \"\"\"统一同步设置 layout 检测框的标签名和类别编号。\"\"\"\n        if label not in PP_DOCLAYOUT_V2_LABEL_TO_ID:\n            raise ValueError(f\"Unsupported PP-DocLayoutV2 label: {label}\")\n        box[\"label\"] = label\n        box[\"cls_id\"] = PP_DOCLAYOUT_V2_LABEL_TO_ID[label]\n\n    @staticmethod\n    def _set_formula_label(box: Dict, label: str) -> None:\n        if label not in {\"inline_formula\", \"display_formula\"}:\n            raise ValueError(f\"Unsupported formula label: {label}\")\n        PPDocLayoutV2LayoutModel._set_box_label(box, label)\n\n    @staticmethod\n    def _set_header_footer_label(box: Dict, label: str) -> None:\n        \"\"\"同步设置页眉/页脚相关标签及其类别编号。\"\"\"\n        if label not in {\"footer\", \"footer_image\", \"header\", \"header_image\"}:\n            raise ValueError(f\"Unsupported header/footer label: {label}\")\n        PPDocLayoutV2LayoutModel._set_box_label(box, label)\n\n    @staticmethod\n    def _set_footnote_label(box: Dict) -> None:","sourceCodeStart":1172,"sourceCodeEnd":1208,"githubUrl":"https://github.com/opendatalab/MinerU/blob/4fe4bde114a23ee5dd637eae99b767f4669bf58c/mineru/model/layout/pp_doclayoutv2.py#L1172-L1208","documentation":"ValueError raised by PPDocLayoutV2LayoutModel._set_box_label when label is not a key of PP_DOCLAYOUT_V2_LABEL_TO_ID (the 25 fixed class names 'abstract'..'vision_footnote' with ids 0..24). The helper keeps box['label'] and box['cls_id'] in sync, so unknown labels cannot be assigned an id and are rejected.","triggerScenarios":"Calling _set_box_label(box, 'caption') or any string outside PP_DOCLAYOUT_V2_LABELS; also custom post-processing code that renames labels before calling helpers like _set_header_footer_label / _set_footnote_label, which delegate to this method.","commonSituations":"Porting label vocabularies from other layout models (PubLayNet, DocBank) whose names differ; typos ('paragragh_title'); new custom classes added by users without extending the mapping; version differences in label sets.","solutions":["Use one of the 25 supported labels exactly as spelled in PP_DOCLAYOUT_V2_LABELS (e.g. 'text', 'image', 'table', 'figure_title', 'footnote').","Map your vocabulary to the supported one before calling the helper.","If you truly need new classes, extend PP_DOCLAYOUT_V2_LABELS and retrain — runtime relabeling cannot invent ids."],"exampleFix":"# before\nPPDocLayoutV2LayoutModel._set_box_label(box, 'caption')  # ValueError\n\n# after\nPPDocLayoutV2LayoutModel._set_box_label(box, 'figure_title')","handlingStrategy":"validation","validationCode":"from mineru.model.layout.pp_doclayoutv2 import PP_DOCLAYOUT_V2_LABEL_TO_ID\n\ndef safe_set_box_label(box: dict, label: str) -> None:\n    if label not in PP_DOCLAYOUT_V2_LABEL_TO_ID:\n        raise ValueError(\n            f'label {label!r} unsupported; valid labels: {sorted(PP_DOCLAYOUT_V2_LABEL_TO_ID)}'\n        )\n    PPDocLayoutV2LayoutModel._set_box_label(box, label)","typeGuard":"def is_supported_label(label: str) -> bool:\n    from mineru.model.layout.pp_doclayoutv2 import PP_DOCLAYOUT_V2_LABEL_TO_ID\n    return label in PP_DOCLAYOUT_V2_LABEL_TO_ID","tryCatchPattern":null,"preventionTips":["Import PP_DOCLAYOUT_V2_LABEL_TO_ID and validate labels against it before relabeling boxes.","Map external vocabularies (DocBank, PubLayNet) to the 25 supported names at ingest.","Beware near-miss spellings: 'figure_title' not 'caption', 'paragraph_title' not 'paragragh_title'."],"tags":["layout-model","labels","validation","postprocessing"],"backgroundTag":null,"analyzedSha":"4fe4bde114a23ee5dd637eae99b767f4669bf58c","analyzedAt":"2026-08-14T21:29:18.456Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}