Skip to content

Commit 3383c44

Browse files
committed
Fix: KeyError: 'table_body' of mineru parser #10769
### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
1 parent 0ff2042 commit 3383c44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

deepdoc/parser/mineru_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ def _transfer_to_sections(self, outputs: list[dict[str, Any]]):
254254
case MinerUContentType.TEXT:
255255
section = output["text"]
256256
case MinerUContentType.TABLE:
257-
section = output["table_body"] + "\n".join(output["table_caption"]) + "\n".join(output["table_footnote"])
257+
section = output.get("table_body", "") + "\n".join(output.get("table_caption", [])) + "\n".join(output.get("table_footnote", []))
258258
case MinerUContentType.IMAGE:
259-
section = "".join(output["image_caption"]) + "\n" + "".join(output["image_footnote"])
259+
section = "".join(output.get("image_caption", [])) + "\n" + "".join(output.get("image_footnote", []))
260260
case MinerUContentType.EQUATION:
261261
section = output["text"]
262262

0 commit comments

Comments
 (0)