|
|
@@ -1,20 +1,19 @@
|
|
|
## Overview
|
|
|
|
|
|
-After executing the `magic-pdf` command, in addition to outputting files related to markdown, several other files unrelated to markdown will also be generated. These files will be introduced one by one.
|
|
|
+After executing the `mineru` command, in addition to outputting files related to markdown, several other files unrelated to markdown will also be generated. These files will be introduced one by one.
|
|
|
|
|
|
### some_pdf_layout.pdf
|
|
|
|
|
|
-Each page layout consists of one or more boxes. The number at the top left of each box indicates its sequence number. Additionally, in `layout.pdf`, different content blocks are highlighted with different background colors.
|
|
|
-
|
|
|
+Each page's layout consists of one or more bounding boxes. The number in the top-right corner of each box indicates the reading order. Additionally, different content blocks are highlighted with distinct background colors within the layout.pdf.
|
|
|

|
|
|
|
|
|
-### some_pdf_spans.pdf
|
|
|
+### some_pdf_spans.pdf(Applicable only to the pipeline backend)
|
|
|
|
|
|
All spans on the page are drawn with different colored line frames according to the span type. This file can be used for quality control, allowing for quick identification of issues such as missing text or unrecognized inline formulas.
|
|
|
|
|
|

|
|
|
|
|
|
-### some_pdf_model.json
|
|
|
+### some_pdf_model.json(Applicable only to the pipeline backend)
|
|
|
|
|
|
#### Structure Definition
|
|
|
|
|
|
@@ -117,13 +116,39 @@ The format of the poly coordinates is \[x0, y0, x1, y1, x2, y2, x3, y3\], repres
|
|
|
]
|
|
|
```
|
|
|
|
|
|
+### some_pdf_model_output.txt (Applicable only to the VLM backend)
|
|
|
+
|
|
|
+This file contains the output of the VLM model, with each page's output separated by `----`.
|
|
|
+Each page's output consists of text blocks starting with `<|box_start|>` and ending with `<|md_end|>`.
|
|
|
+The meaning of each field is as follows:
|
|
|
+- `<|box_start|>x0 y0 x1 y1<|box_end|>`
|
|
|
+ x0 y0 x1 y1 represent the coordinates of a quadrilateral, indicating the top-left and bottom-right points. The values are based on a normalized page size of 1000x1000.
|
|
|
+- `<|ref_start|>type<|ref_end|>`
|
|
|
+ `type` indicates the block type. Possible values are:
|
|
|
+ ```json
|
|
|
+ {
|
|
|
+ "text": "Text",
|
|
|
+ "title": "Title",
|
|
|
+ "image": "Image",
|
|
|
+ "image_caption": "Image Caption",
|
|
|
+ "image_footnote": "Image Footnote",
|
|
|
+ "table": "Table",
|
|
|
+ "table_caption": "Table Caption",
|
|
|
+ "table_footnote": "Table Footnote",
|
|
|
+ "equation": "Interline Equation"
|
|
|
+ }
|
|
|
+ ```
|
|
|
+- `<|md_start|>Markdown content<|md_end|>`
|
|
|
+ This field contains the Markdown content of the block. If `type` is `text`, the end of the text may contain the `<|txt_contd|>` tag, indicating that this block can be connected with the following `text` block(s).
|
|
|
+ If `type` is `table`, the content is in `otsl` format and needs to be converted into HTML for rendering in Markdown.
|
|
|
+
|
|
|
### some_pdf_middle.json
|
|
|
|
|
|
| Field Name | Description |
|
|
|
-| :------------- | :------------------------------------------------------------------------------------------------------------- |
|
|
|
+|:---------------| :------------------------------------------------------------------------------------------------------------- |
|
|
|
| pdf_info | list, each element is a dict representing the parsing result of each PDF page, see the table below for details |
|
|
|
-| \_parse_type | ocr \| txt, used to indicate the mode used in this intermediate parsing state |
|
|
|
-| \_version_name | string, indicates the version of magic-pdf used in this parsing |
|
|
|
+| \_backend | pipeline \| vlm, used to indicate the mode used in this intermediate parsing state |
|
|
|
+| \_version_name | string, indicates the version of mineru used in this parsing |
|
|
|
|
|
|
<br>
|
|
|
|
|
|
@@ -324,7 +349,20 @@ First-level block (if any) -> Second-level block -> Line -> Span
|
|
|
]
|
|
|
}
|
|
|
],
|
|
|
- "_parse_type": "txt",
|
|
|
+ "_backend": "pipeline",
|
|
|
"_version_name": "0.6.1"
|
|
|
}
|
|
|
```
|
|
|
+
|
|
|
+
|
|
|
+### some_pdf_content_list.json
|
|
|
+
|
|
|
+This file is a JSON array where each element is a dict storing all readable content blocks in the document in reading order.
|
|
|
+`content_list` can be viewed as a simplified version of `middle.json`. The content block types are mostly consistent with those in `middle.json`, but layout information is not included.
|
|
|
+
|
|
|
+Please note that both `title` and text blocks in `content_list` are uniformly represented using the text type. The `text_level` field is used to distinguish the hierarchy of text blocks:
|
|
|
+- A block without the `text_level` field or with `text_level=0` represents body text.
|
|
|
+- A block with `text_level=1` represents a level-1 heading.
|
|
|
+- A block with `text_level=2` represents a level-2 heading, and so on.
|
|
|
+
|
|
|
+Each dict contains the `page_idx` field, indicating the page number (starting from 0) where the content block resides.
|