magic-pdf 0.8.1__py3-none-any.whl → 0.9.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. magic_pdf/config/__init__.py +0 -0
  2. magic_pdf/config/enums.py +7 -0
  3. magic_pdf/config/exceptions.py +32 -0
  4. magic_pdf/data/__init__.py +0 -0
  5. magic_pdf/data/data_reader_writer/__init__.py +12 -0
  6. magic_pdf/data/data_reader_writer/base.py +51 -0
  7. magic_pdf/data/data_reader_writer/filebase.py +59 -0
  8. magic_pdf/data/data_reader_writer/multi_bucket_s3.py +143 -0
  9. magic_pdf/data/data_reader_writer/s3.py +73 -0
  10. magic_pdf/data/dataset.py +194 -0
  11. magic_pdf/data/io/__init__.py +6 -0
  12. magic_pdf/data/io/base.py +42 -0
  13. magic_pdf/data/io/http.py +37 -0
  14. magic_pdf/data/io/s3.py +114 -0
  15. magic_pdf/data/read_api.py +95 -0
  16. magic_pdf/data/schemas.py +19 -0
  17. magic_pdf/data/utils.py +32 -0
  18. magic_pdf/dict2md/ocr_mkcontent.py +106 -244
  19. magic_pdf/libs/Constants.py +21 -8
  20. magic_pdf/libs/MakeContentConfig.py +1 -0
  21. magic_pdf/libs/boxbase.py +35 -0
  22. magic_pdf/libs/clean_memory.py +10 -0
  23. magic_pdf/libs/config_reader.py +53 -23
  24. magic_pdf/libs/draw_bbox.py +150 -65
  25. magic_pdf/libs/ocr_content_type.py +2 -0
  26. magic_pdf/libs/version.py +1 -1
  27. magic_pdf/model/doc_analyze_by_custom_model.py +77 -32
  28. magic_pdf/model/magic_model.py +331 -15
  29. magic_pdf/model/pdf_extract_kit.py +170 -83
  30. magic_pdf/model/pek_sub_modules/structeqtable/StructTableModel.py +40 -16
  31. magic_pdf/model/ppTableModel.py +8 -6
  32. magic_pdf/model/pp_structure_v2.py +5 -2
  33. magic_pdf/model/v3/__init__.py +0 -0
  34. magic_pdf/model/v3/helpers.py +125 -0
  35. magic_pdf/para/para_split_v3.py +322 -0
  36. magic_pdf/pdf_parse_by_ocr.py +6 -3
  37. magic_pdf/pdf_parse_by_txt.py +6 -3
  38. magic_pdf/pdf_parse_union_core_v2.py +644 -0
  39. magic_pdf/pipe/AbsPipe.py +5 -1
  40. magic_pdf/pipe/OCRPipe.py +10 -4
  41. magic_pdf/pipe/TXTPipe.py +10 -4
  42. magic_pdf/pipe/UNIPipe.py +16 -7
  43. magic_pdf/pre_proc/ocr_detect_all_bboxes.py +83 -1
  44. magic_pdf/pre_proc/ocr_dict_merge.py +27 -2
  45. magic_pdf/resources/model_config/UniMERNet/demo.yaml +7 -7
  46. magic_pdf/resources/model_config/model_configs.yaml +5 -13
  47. magic_pdf/tools/cli.py +14 -1
  48. magic_pdf/tools/common.py +18 -8
  49. magic_pdf/user_api.py +25 -6
  50. magic_pdf/utils/__init__.py +0 -0
  51. magic_pdf/utils/annotations.py +11 -0
  52. {magic_pdf-0.8.1.dist-info → magic_pdf-0.9.1.dist-info}/LICENSE.md +1 -0
  53. {magic_pdf-0.8.1.dist-info → magic_pdf-0.9.1.dist-info}/METADATA +124 -78
  54. {magic_pdf-0.8.1.dist-info → magic_pdf-0.9.1.dist-info}/RECORD +57 -33
  55. {magic_pdf-0.8.1.dist-info → magic_pdf-0.9.1.dist-info}/WHEEL +0 -0
  56. {magic_pdf-0.8.1.dist-info → magic_pdf-0.9.1.dist-info}/entry_points.txt +0 -0
  57. {magic_pdf-0.8.1.dist-info → magic_pdf-0.9.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: magic-pdf
3
- Version: 0.8.1
3
+ Version: 0.9.1
4
4
  Summary: A practical tool for converting PDF to Markdown
5
5
  Home-page: https://github.com/opendatalab/MinerU
6
6
  Requires-Python: >=3.9
@@ -16,13 +16,16 @@ Requires-Dist: pdfminer.six==20231228
16
16
  Requires-Dist: pydantic<2.8.0,>=2.7.2
17
17
  Requires-Dist: PyMuPDF>=1.24.9
18
18
  Requires-Dist: scikit-learn>=1.0.2
19
- Requires-Dist: wordninja>=2.0.0
19
+ Requires-Dist: torch<=2.3.1,>=2.2.2
20
+ Requires-Dist: transformers
20
21
  Provides-Extra: full
21
- Requires-Dist: unimernet==0.1.6; extra == "full"
22
+ Requires-Dist: unimernet==0.2.1; extra == "full"
22
23
  Requires-Dist: ultralytics; extra == "full"
23
24
  Requires-Dist: paddleocr==2.7.3; extra == "full"
24
- Requires-Dist: pypandoc; extra == "full"
25
- Requires-Dist: struct-eqtable==0.1.0; extra == "full"
25
+ Requires-Dist: struct-eqtable==0.3.2; extra == "full"
26
+ Requires-Dist: einops; extra == "full"
27
+ Requires-Dist: accelerate; extra == "full"
28
+ Requires-Dist: doclayout-yolo==0.0.2; extra == "full"
26
29
  Requires-Dist: detectron2; extra == "full"
27
30
  Requires-Dist: paddlepaddle==3.0.0b1; platform_system == "Linux" and extra == "full"
28
31
  Requires-Dist: matplotlib; (platform_system == "Linux" or platform_system == "Darwin") and extra == "full"
@@ -52,8 +55,9 @@ Requires-Dist: paddlepaddle==2.6.1; (platform_system == "Windows" or platform_sy
52
55
  [![OpenDataLab](https://img.shields.io/badge/Demo_on_OpenDataLab-blue?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbD0ibm9uZSI+CiA8ZGVmcz4KICA8bGluZWFyR3JhZGllbnQgeTI9IjAuNTMzNjciIHgyPSIxLjAwMDQiIHkxPSIwLjI5MjE5IiB4MT0iLTAuMTEyNjgiIGlkPSJhIj4KICAgPHN0b3Agc3RvcC1jb2xvcj0iIzE1NDNGRSIvPgogICA8c3RvcCBzdG9wLWNvbG9yPSIjOEM0NkZGIiBvZmZzZXQ9IjEiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxsaW5lYXJHcmFkaWVudCB5Mj0iMC41OTc1NyIg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WxsPSIjZmZmIiBkPSJtMjIuODk4LDEzLjc3MWwxLjE0LDBsMCwxLjE0MWwtMS4xNCwwbDAsLTEuMTRsMCwtMC4wMDF6bS0yLjgxMiwtMC42OTJsMS44MzQsMGwwLDEuODMzbC0xLjgzNCwwbDAsLTEuODMybDAsLTAuMDAxem0xLjgzNCwtMC45NzlsMC45NzgsMGwwLDAuOTc5bC0wLjk3OCwwbDAsLTAuOTc5em0xLjU0OCwtMS42MjlsMC42MTEsMGwwLDAuNjExbC0wLjYxLDBsMCwtMC42MWwtMC4wMDEsLTAuMDAxeiIvPgogPC9nPgo8L3N2Zz4=&labelColor=white)](https://opendatalab.com/OpenSourceTools/Extractor/PDF)
53
56
  [![HuggingFace](https://img.shields.io/badge/Demo_on_HuggingFace-yellow.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAABYCAMAAACkl9t/AAAAk1BMVEVHcEz/nQv/nQv/nQr/nQv/nQr/nQv/nQv/nQr/wRf/txT/pg7/yRr/rBD/zRz/ngv/oAz/zhz/nwv/txT/ngv/0B3+zBz/nQv/0h7/wxn/vRb/thXkuiT/rxH/pxD/ogzcqyf/nQvTlSz/czCxky7/SjifdjT/Mj3+Mj3wMj15aTnDNz+DSD9RTUBsP0FRO0Q6O0WyIxEIAAAAGHRSTlMADB8zSWF3krDDw8TJ1NbX5efv8ff9/fxKDJ9uAAAGKklEQVR42u2Z63qjOAyGC4RwCOfB2JAGqrSb2WnTw/1f3UaWcSGYNKTdf/P+mOkTrE+yJBulvfvLT2A5ruenaVHyIks33npl/6C4s/ZLAM45SOi/1FtZPyFur1OYofBX3w7d54Bxm+E8db+nDr12ttmESZ4zludJEG5S7TO72YPlKZFyE+YCYUJTBZsMiNS5Sd7NlDmKM2Eg2JQg8awbglfqgbhArjxkS7dgp2RH6hc9AMLdZYUtZN5DJr4molC8BfKrEkPKEnEVjLbgW1fLy77ZVOJagoIcLIl+IxaQZGjiX597HopF5CkaXVMDO9Pyix3AFV3kw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maxLjJmjQ18rA0YCkxLQbUZP1WqdmyQGJLUm7VnQFqodmXSqmRrdVpqdzk5LvmvgtEcW8PMGdaS23EOWyDVbACZzUJPaqMbjDxpA3Qrgl0AikimGDbqmyT8P8NOYiqrldF8rX+YN7TopX4UoHuSCYY7cgX4gHwclQKl1zhx0THf+tCAUValzjI7Wg9EhptrkIcfIJjA94evOn8B2eHaVzvBrnl2ig0So6hvPaz0IGcOvTHvUIlE2+prqAxLSQxZlU2stql1NqCCLdIiIN/i1DBEHUoElM9dBravbiAnKqgpi4IBkw+utSPIoBijDXJipSVV7MpOEJUAc5Qmm3BnUN+w3hteEieYKfRZSIUcXKMVf0u5wD4EwsUNVvZOtUT7A2GkffHjByWpHqvRBYrTV72a6j8zZ6W0DTE86Hn04bmyWX3Ri9WH7ZU6Q7h+ZHo0nHUAcsQvVhXRDZHChwiyi/hnPuOsSEF6Exk3o6Y9DT1eZ+6cASXk2Y9k+6EOQMDGm6WBK10wOQJCBwren86cPPWUcRAnTVjGcU1LBgs9FURiX/e6479yZcLwCBmTxiawEwrOcleuu12t3tbLv/N4RLYIBhYexm7Fcn4OJcn0+zc+s8/VfPeddZHAGN6TT8eGczHdR/Gts1/MzDkThr23zqrVfAMFT33Nx1RJsx1k5zuWILLnG/vsH+Fv5D4NTVcp1Gzo8AAAAAElFTkSuQmCC&labelColor=white)](https://huggingface.co/spaces/opendatalab/MinerU)
54
57
  [![ModelScope](https://img.shields.io/badge/Demo_on_ModelScope-purple?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIzIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCiA8Zz4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiAgPHBhdGggaWQ9InN2Z18xNCIgZmlsbD0iIzYyNGFmZiIgZD0ibTAsODkuODRsMjUuNjUsMGwwLDI1LjY0OTk5bC0yNS42NSwwbDAsLTI1LjY0OTk5eiIv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iLz4KICA8cGF0aCBpZD0ic3ZnXzIzIiBmaWxsPSIjNjI0YWZmIiBkPSJtNDcuODQsNjQuMTlsMjUuNjUsMGwwLC0yMi4xOWwtNDcuODQsMGwwLDQ3Ljg0bDIyLjE5LDBsMCwtMjUuNjV6Ii8+CiAgPHBhdGggaWQ9InN2Z18yNCIgZmlsbD0iIzYyNGFmZiIgZD0ibTQ3Ljg0LDExNS40OWwtMjIuMTksMGwwLDQ3Ljg0bDQ3Ljg0LDBsMCwtMjIuMTlsLTI1LjY1LDBsMCwtMjUuNjV6Ii8+CiA8L2c+Cjwvc3ZnPg==&labelColor=white)](https://www.modelscope.cn/studios/OpenDataLab/MinerU)
55
- [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/gist/papayalove/b5f4913389e7ff9883c6b687de156e78/mineru_demo.ipynb)
56
- [![Paper](https://img.shields.io/badge/Paper-arXiv-green)](#)
58
+ [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/gist/myhloli/3b3a00a4a0a61577b6c30f989092d20d/mineru_demo.ipynb)
59
+ [![Paper](https://img.shields.io/badge/Paper-arXiv-green)](https://arxiv.org/abs/2409.18839)
60
+
57
61
 
58
62
  <a href="https://trendshift.io/repositories/11174" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11174" alt="opendatalab%2FMinerU | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
59
63
 
@@ -76,6 +80,20 @@ Requires-Dist: paddlepaddle==2.6.1; (platform_system == "Windows" or platform_sy
76
80
  </div>
77
81
 
78
82
  # Changelog
83
+ - 2024/11/06 0.9.1 released. Integrated the [StructTable-InternVL2-1B](https://huggingface.co/U4R/StructTable-InternVL2-1B) model for table recognition functionality.
84
+ - 2024/10/31 0.9.0 released. This is a major new version with extensive code refactoring, addressing numerous issues, improving performance, reducing hardware requirements, and enhancing usability:
85
+ - Refactored the sorting module code to use [layoutreader](https://github.com/ppaanngggg/layoutreader) for reading order sorting, ensuring high accuracy in various layouts.
86
+ - Refactored the paragraph concatenation module to achieve good results in cross-column, cross-page, cross-figure, and cross-table scenarios.
87
+ - Refactored the list and table of contents recognition functions, significantly improving the accuracy of list blocks and table of contents blocks, as well as the parsing of corresponding text paragraphs.
88
+ - Refactored the matching logic for figures, tables, and descriptive text, greatly enhancing the accuracy of matching captions and footnotes to figures and tables, and reducing the loss rate of descriptive text to near zero.
89
+ - Added multi-language support for OCR, supporting detection and recognition of 84 languages.For the list of supported languages, see [OCR Language Support List](https://paddlepaddle.github.io/PaddleOCR/latest/en/ppocr/blog/multi_languages.html#5-support-languages-and-abbreviations).
90
+ - Added memory recycling logic and other memory optimization measures, significantly reducing memory usage. The memory requirement for enabling all acceleration features except table acceleration (layout/formula/OCR) has been reduced from 16GB to 8GB, and the memory requirement for enabling all acceleration features has been reduced from 24GB to 10GB.
91
+ - Optimized configuration file feature switches, adding an independent formula detection switch to significantly improve speed and parsing results when formula detection is not needed.
92
+ - Integrated [PDF-Extract-Kit 1.0](https://github.com/opendatalab/PDF-Extract-Kit):
93
+ - Added the self-developed `doclayout_yolo` model, which speeds up processing by more than 10 times compared to the original solution while maintaining similar parsing effects, and can be freely switched with `layoutlmv3` via the configuration file.
94
+ - Upgraded formula parsing to `unimernet 0.2.1`, improving formula parsing accuracy while significantly reducing memory usage.
95
+ - Due to the repository change for `PDF-Extract-Kit 1.0`, you need to re-download the model. Please refer to [How to Download Models](docs/how_to_download_models_en.md) for detailed steps.
96
+ - 2024/09/27 Version 0.8.1 released, Fixed some bugs, and providing a [localized deployment version](projects/web_demo/README.md) of the [online demo](https://opendatalab.com/OpenSourceTools/Extractor/PDF/) and the [front-end interface](projects/web/README.md).
79
97
  - 2024/09/09: Version 0.8.0 released, supporting fast deployment with Dockerfile, and launching demos on Huggingface and Modelscope.
80
98
  - 2024/08/30: Version 0.7.1 released, add paddle tablemaster table recognition option
81
99
  - 2024/08/09: Version 0.7.0b1 released, simplified installation process, added table recognition functionality
@@ -103,6 +121,7 @@ Requires-Dist: paddlepaddle==2.6.1; (platform_system == "Windows" or platform_sy
103
121
  <ul>
104
122
  <li><a href="#command-line">Command Line</a></li>
105
123
  <li><a href="#api">API</a></li>
124
+ <li><a href="#deploy-derived-projects">Deploy Derived Projects</a></li>
106
125
  <li><a href="#development-guide">Development Guide</a></li>
107
126
  </ul>
108
127
  </li>
@@ -134,15 +153,18 @@ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
134
153
 
135
154
  ## Key Features
136
155
 
137
- - Removes elements such as headers, footers, footnotes, and page numbers while maintaining semantic continuity
138
- - Outputs text in a human-readable order from multi-column documents
139
- - Retains the original structure of the document, including titles, paragraphs, and lists
140
- - Extracts images, image captions, tables, and table captions
141
- - Automatically recognizes formulas in the document and converts them to LaTeX
142
- - Automatically recognizes tables in the document and converts them to LaTeX
143
- - Automatically detects and enables OCR for corrupted PDFs
144
- - Supports both CPU and GPU environments
145
- - Supports Windows, Linux, and Mac platforms
156
+ - Remove headers, footers, footnotes, page numbers, etc., to ensure semantic coherence.
157
+ - Output text in human-readable order, suitable for single-column, multi-column, and complex layouts.
158
+ - Preserve the structure of the original document, including headings, paragraphs, lists, etc.
159
+ - Extract images, image descriptions, tables, table titles, and footnotes.
160
+ - Automatically recognize and convert formulas in the document to LaTeX format.
161
+ - Automatically recognize and convert tables in the document to LaTeX or HTML format.
162
+ - Automatically detect scanned PDFs and garbled PDFs and enable OCR functionality.
163
+ - OCR supports detection and recognition of 84 languages.
164
+ - Supports multiple output formats, such as multimodal and NLP Markdown, JSON sorted by reading order, and rich intermediate formats.
165
+ - Supports various visualization results, including layout visualization and span visualization, for efficient confirmation of output quality.
166
+ - Supports both CPU and GPU environments.
167
+ - Compatible with Windows, Linux, and Mac platforms.
146
168
 
147
169
  ## Quick Start
148
170
 
@@ -173,8 +195,8 @@ In non-mainline environments, due to the diversity of hardware and software conf
173
195
  </tr>
174
196
  <tr>
175
197
  <td colspan="3">CPU</td>
176
- <td>x86_64</td>
177
- <td>x86_64</td>
198
+ <td>x86_64(unsupported ARM Linux)</td>
199
+ <td>x86_64(unsupported ARM Windows)</td>
178
200
  <td>x86_64 / arm64</td>
179
201
  </tr>
180
202
  <tr>
@@ -183,7 +205,7 @@ In non-mainline environments, due to the diversity of hardware and software conf
183
205
  </tr>
184
206
  <tr>
185
207
  <td colspan="3">Python Version</td>
186
- <td colspan="3">3.10</td>
208
+ <td colspan="3">3.10(Please make sure to create a Python 3.10 virtual environment using conda)</td>
187
209
  </tr>
188
210
  <tr>
189
211
  <td colspan="3">Nvidia Driver Version</td>
@@ -200,22 +222,24 @@ In non-mainline environments, due to the diversity of hardware and software conf
200
222
  <tr>
201
223
  <td rowspan="2">GPU Hardware Support List</td>
202
224
  <td colspan="2">Minimum Requirement 8G+ VRAM</td>
203
- <td colspan="2">3060ti/3070/3080/3080ti/4060/4070/4070ti<br>
204
- 8G VRAM only enables layout and formula recognition acceleration</td>
225
+ <td colspan="2">3060ti/3070/4060<br>
226
+ 8G VRAM enables layout, formula recognition acceleration and OCR acceleration</td>
205
227
  <td rowspan="2">None</td>
206
228
  </tr>
207
229
  <tr>
208
- <td colspan="2">Recommended Configuration 16G+ VRAM</td>
209
- <td colspan="2">3090/3090ti/4070ti super/4080/4090<br>
210
- 16G or more can enable layout, formula recognition, and OCR acceleration simultaneously<br>
211
- 24G or more can enable layout, formula recognition, OCR acceleration and table recognition simultaneously
230
+ <td colspan="2">Recommended Configuration 10G+ VRAM</td>
231
+ <td colspan="2">3080/3080ti/3090/3090ti/4070/4070ti/4070tisuper/4080/4090<br>
232
+ 10G VRAM or more can enable layout, formula recognition, OCR acceleration and table recognition acceleration simultaneously
212
233
  </td>
213
234
  </tr>
214
235
  </table>
215
236
 
216
237
  ### Online Demo
217
238
 
239
+ Stable Version (Stable version verified by QA):
218
240
  [![OpenDataLab](https://img.shields.io/badge/Demo_on_OpenDataLab-blue?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iM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BsMCwwLjYxMWwtMC42MTEsMGwwLC0wLjYxMXoiLz4KICA8cGF0aCBpZD0ic3ZnXzYiIGZpbGw9IiNmZmYiIGQ9Im0yMC4wODYsMTQuOTEybDAsMS43MTFhMi40MDQsMi40MDQgMCAxIDEgLTQuODA3LDBsMCwtNC4yNzhsLTIuODEyLDBsMCw0LjY4NmE1LjIxNSw1LjIxNSAwIDAgMCAxMC40MywwbDAsLTQuNjg2bDAsMi41NjdsLTIuODEsMGwtMC4wMDEsMHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgPHBhdGggaWQ9InN2Z183IiBmaWxsPSIjZmZmIiBkPSJtMjIuODk4LDEzLjc3MWwxLjE0LDBsMCwxLjE0MWwtMS4xNCwwbDAsLTEuMTRsMCwtMC4wMDF6bS0yLjgxMiwtMC42OTJsMS44MzQsMGwwLDEuODMzbC0xLjgzNCwwbDAsLTEuODMybDAsLTAuMDAxem0xLjgzNCwtMC45NzlsMC45NzgsMGwwLDAuOTc5bC0wLjk3OCwwbDAsLTAuOTc5em0xLjU0OCwtMS42MjlsMC42MTEsMGwwLDAuNjExbC0wLjYxLDBsMCwtMC42MWwtMC4wMDEsLTAuMDAxeiIvPgogPC9nPgo8L3N2Zz4=&labelColor=white)](https://opendatalab.com/OpenSourceTools/Extractor/PDF)
241
+
242
+ Test Version (Synced with dev branch updates, testing new features):
219
243
  [![HuggingFace](https://img.shields.io/badge/Demo_on_HuggingFace-yellow.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAABYCAMAAACkl9t/AAAAk1BMVEVHcEz/nQv/nQv/nQr/nQv/nQr/nQv/nQv/nQr/wRf/txT/pg7/yRr/rBD/zRz/ngv/oAz/zhz/nwv/txT/ngv/0B3+zBz/nQv/0h7/wxn/vRb/thXkuiT/rxH/pxD/ogzcqyf/nQvTlSz/czCxky7/SjifdjT/Mj3+Mj3wMj15aTnDNz+DSD9RTUBsP0FRO0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H+Fv5D4NTVcp1Gzo8AAAAAElFTkSuQmCC&labelColor=white)](https://huggingface.co/spaces/opendatalab/MinerU)
220
244
  [![ModelScope](https://img.shields.io/badge/Demo_on_ModelScope-purple?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIzIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCiA8Zz4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiAgPHBhdGggaWQ9InN2Z18xNCIgZmlsbD0iIzYyNGFmZiIgZD0ibTAsODkuODRsMjUuNjUsMGwwLDI1LjY0OTk5bC0yNS42NSwwbDAsLTI1LjY0OTk5eiIvPgogIDxwYXRoIGlkPSJzdmdfMTUiIGZpbGw9IiM2MjRhZmYiIGQ9Im05OS4xNCwxMTUuNDlsMjUuNjUsMGwwLDI1LjY1bC0yNS42NSwwbDAsLTI1LjY1eiIvPgogIDxwYXRoIGlkPSJzdmdfMTYiIGZpbGw9IiM2MjRhZmYiIGQ9Im0xNzYuMDksMTQxLjE0bC0yNS42NDk5OSwwbDAsMjIuMTlsNDcuODQsMGwwLC00Ny44NGwtMjIuMTksMGwwLDI1LjY1eiIvPgogIDxwYXRoIGlkPSJzdmdfMTciIGZpbGw9IiMzNmNmZDEiIGQ9Im0xMjQuNzksODkuODRsMjUuNjUsMGwwLDI1LjY0OTk5bC0yNS42NSwwbDAsLTI1LjY0OTk5eiIvPgogIDxwYXRoIGlkPSJzdmdfMTgiIGZpbGw9IiMzNmNmZDEiIGQ9Im0wLDY0LjE5bDI1LjY1LDBsMCwyNS42NWwtMjUuNjUsMGwwLC0yNS42NXoiLz4KICA8cGF0aCBpZD0ic3ZnXzE5IiBmaWxsPSIjNjI0YWZmIiBkPSJtMTk4LjI4LDg5Ljg0bDI1LjY0OTk5LDBsMCwyNS42NDk5OWwtMjUuNjQ5OTksMGwwLC0yNS42NDk5OXoiLz4KICA8cGF0aCBpZD0ic3ZnXzIwIiBmaWxsPSIjMzZjZmQxIiBkPSJtMTk4LjI4LDY0LjE5bDI1LjY0OTk5LDBsMCwyNS42NWwtMjUuNjQ5OTksMGwwLC0yNS42NXoiLz4KICA8cGF0aCBpZD0ic3ZnXzIxIiBmaWxsPSIjNjI0YWZmIiBkPSJtMTUwLjQ0LDQybDAsMjIuMTlsMjUuNjQ5OTksMGwwLDI1LjY1bDIyLjE5LDBsMCwtNDcuODRsLTQ3Ljg0LDB6Ii8+CiAgPHBhdGggaWQ9InN2Z18yMiIgZmlsbD0iIzM2Y2ZkMSIgZD0ibTczLjQ5LDg5Ljg0bDI1LjY1LDBsMCwyNS42NDk5OWwtMjUuNjUsMGwwLC0yNS42NDk5OXoiLz4KICA8cGF0aCBpZD0ic3ZnXzIzIiBmaWxsPSIjNjI0YWZmIiBkPSJtNDcuODQsNjQuMTlsMjUuNjUsMGwwLC0yMi4xOWwtNDcuODQsMGwwLDQ3Ljg0bDIyLjE5LDBsMCwtMjUuNjV6Ii8+CiAgPHBhdGggaWQ9InN2Z18yNCIgZmlsbD0iIzYyNGFmZiIgZD0ibTQ3Ljg0LDExNS40OWwtMjIuMTksMGwwLDQ3Ljg0bDQ3Ljg0LDBsMCwtMjIuMTlsLTI1LjY1LDBsMCwtMjUuNjV6Ii8+CiA8L2c+Cjwvc3ZnPg==&labelColor=white)](https://www.modelscope.cn/studios/OpenDataLab/MinerU)
221
245
 
@@ -233,37 +257,32 @@ pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com
233
257
 
234
258
  Refer to [How to Download Model Files](docs/how_to_download_models_en.md) for detailed instructions.
235
259
 
236
- > ❗️After downloading the models, please make sure to verify the completeness of the model files.
237
- >
238
- > Check if the model file sizes match the description on the webpage. If possible, use sha256 to verify the integrity of the files.
260
+ #### 3. Modify the Configuration File for Additional Configuration
239
261
 
240
- #### 3. Copy and configure the template file
262
+ After completing the [2. Download model weight files](#2-download-model-weight-files) step, the script will automatically generate a `magic-pdf.json` file in the user directory and configure the default model path.
263
+ You can find the `magic-pdf.json` file in your 【user directory】.
241
264
 
242
- You can find the `magic-pdf.template.json` template configuration file in the root directory of the repository.
265
+ > The user directory for Windows is "C:\\Users\\username", for Linux it is "/home/username", and for macOS it is "/Users/username".
243
266
 
244
- > ❗️Make sure to execute the following command to copy the configuration file to your **user directory**; otherwise, the program will not run.
245
- >
246
- > The user directory for Windows is `C:\Users\YourUsername`, for Linux it is `/home/YourUsername`, and for macOS it is `/Users/YourUsername`.
267
+ You can modify certain configurations in this file to enable or disable features, such as table recognition:
247
268
 
248
- ```bash
249
- cp magic-pdf.template.json ~/magic-pdf.json
250
- ```
251
269
 
252
- Find the `magic-pdf.json` file in your user directory and configure the "models-dir" path to point to the directory where the model weight files were downloaded in [Step 2](#2-download-model-weight-files).
253
-
254
- > ❗️Make sure to correctly configure the **absolute path** to the model weight files directory, otherwise the program will not run because it can't find the model files.
255
- >
256
- > On Windows, this path should include the drive letter and all backslashes (`\`) in the path should be replaced with forward slashes (`/`) to avoid syntax errors in the JSON file due to escape sequences.
257
- >
258
- > For example: If the models are stored in the "models" directory at the root of the D drive, the "model-dir" value should be `D:/models`.
270
+ > If the following items are not present in the JSON, please manually add the required items and remove the comment content (standard JSON does not support comments).
259
271
 
260
272
  ```json
261
273
  {
262
- // other config
263
- "models-dir": "D:/models",
264
- "table-config": {
265
- "model": "TableMaster", // Another option of this value is 'struct_eqtable'
266
- "is_table_recog_enable": false, // Table recognition is disabled by default, modify this value to enable it
274
+ // other config
275
+ "layout-config": {
276
+ "model": "layoutlmv3" // Please change to "doclayout_yolo" when using doclayout_yolo.
277
+ },
278
+ "formula-config": {
279
+ "mfd_model": "yolo_v8_mfd",
280
+ "mfr_model": "unimernet_small",
281
+ "enable": true // The formula recognition feature is enabled by default. If you need to disable it, please change the value here to "false".
282
+ },
283
+ "table-config": {
284
+ "model": "tablemaster", // When using structEqTable, please change to "struct_eqtable".
285
+ "enable": false, // The table recognition feature is disabled by default. If you need to enable it, please change the value here to "true".
267
286
  "max_time": 400
268
287
  }
269
288
  }
@@ -301,13 +320,26 @@ Usage: magic-pdf [OPTIONS]
301
320
  Options:
302
321
  -v, --version display the version and exit
303
322
  -p, --path PATH local pdf filepath or directory [required]
304
- -o, --output-dir TEXT output local directory
305
- -m, --method [ocr|txt|auto] the method for parsing pdf.
306
- ocr: using ocr technique to extract information from pdf,
307
- txt: suitable for the text-based pdf only and outperform ocr,
308
- auto: automatically choose the best method for parsing pdf
309
- from ocr and txt.
310
- without method specified, auto will be used by default.
323
+ -o, --output-dir PATH output local directory [required]
324
+ -m, --method [ocr|txt|auto] the method for parsing pdf. ocr: using ocr
325
+ technique to extract information from pdf. txt:
326
+ suitable for the text-based pdf only and
327
+ outperform ocr. auto: automatically choose the
328
+ best method for parsing pdf from ocr and txt.
329
+ without method specified, auto will be used by
330
+ default.
331
+ -l, --lang TEXT Input the languages in the pdf (if known) to
332
+ improve OCR accuracy. Optional. You should
333
+ input "Abbreviation" with language form url: ht
334
+ tps://paddlepaddle.github.io/PaddleOCR/latest/en
335
+ /ppocr/blog/multi_languages.html#5-support-languages-
336
+ and-abbreviations
337
+ -d, --debug BOOLEAN Enables detailed debugging information during
338
+ the execution of the CLI commands.
339
+ -s, --start INTEGER The starting page for PDF parsing, beginning
340
+ from 0.
341
+ -e, --end INTEGER The ending page for PDF parsing, beginning from
342
+ 0.
311
343
  --help Show this message and exit.
312
344
 
313
345
 
@@ -324,11 +356,12 @@ The results will be saved in the `{some_output_dir}` directory. The output file
324
356
  ```text
325
357
  ├── some_pdf.md # markdown file
326
358
  ├── images # directory for storing images
327
- ├── some_pdf_layout.pdf # layout diagram
359
+ ├── some_pdf_layout.pdf # layout diagram (Include layout reading order)
328
360
  ├── some_pdf_middle.json # MinerU intermediate processing result
329
361
  ├── some_pdf_model.json # model inference result
330
362
  ├── some_pdf_origin.pdf # original PDF file
331
- └── some_pdf_spans.pdf # smallest granularity bbox position information diagram
363
+ ├── some_pdf_spans.pdf # smallest granularity bbox position information diagram
364
+ └── some_pdf_content_list.json # Rich text JSON arranged in reading order
332
365
  ```
333
366
 
334
367
  For more information about the output files, please refer to the [Output File Description](docs/output_file_en_us.md).
@@ -368,29 +401,38 @@ For detailed implementation, refer to:
368
401
  - [demo.py Simplest Processing Method](demo/demo.py)
369
402
  - [magic_pdf_parse_main.py More Detailed Processing Workflow](demo/magic_pdf_parse_main.py)
370
403
 
404
+ ### Deploy Derived Projects
405
+
406
+ Derived projects include secondary development projects based on MinerU by project developers and community developers,
407
+ such as application interfaces based on Gradio, RAG based on llama, web demos similar to the official website, lightweight multi-GPU load balancing client/server ends, etc.
408
+ These projects may offer more features and a better user experience.
409
+ For specific deployment methods, please refer to the [Derived Project README](projects/README.md)
410
+
411
+
371
412
  ### Development Guide
372
413
 
373
414
  TODO
374
415
 
375
416
  # TODO
376
417
 
377
- - [ ] Semantic-based reading order
378
- - [ ] List recognition within the text
379
- - [ ] Code block recognition within the text
380
- - [ ] Table of contents recognition
381
- - [x] Table recognition
382
- - [ ] [Chemical formula recognition](docs/chemical_knowledge_introduction/introduction.pdf)
383
- - [ ] Geometric shape recognition
418
+ - 🗹 Reading order based on the model
419
+ - 🗹 Recognition of `index` and `list` in the main text
420
+ - 🗹 Table recognition
421
+ - Code block recognition in the main text
422
+ - [Chemical formula recognition](docs/chemical_knowledge_introduction/introduction.pdf)
423
+ - Geometric shape recognition
384
424
 
385
425
  # Known Issues
386
426
 
387
- - Reading order is segmented based on rules, which can cause disordered sequences in some cases
388
- - Vertical text is not supported
389
- - Lists, code blocks, and table of contents are not yet supported in the layout model
390
- - Comic books, art books, elementary school textbooks, and exercise books are not well-parsed yet
391
- - Enabling OCR may produce better results in PDFs with a high density of formulas
392
- - If you are processing PDFs with a large number of formulas, it is strongly recommended to enable the OCR function. When using PyMuPDF to extract text, overlapping text lines can occur, leading to inaccurate formula insertion positions.
393
-
427
+ - Reading order is determined by the model based on the spatial distribution of readable content, and may be out of order in some areas under extremely complex layouts.
428
+ - Vertical text is not supported.
429
+ - Tables of contents and lists are recognized through rules, and some uncommon list formats may not be recognized.
430
+ - Only one level of headings is supported; hierarchical headings are not currently supported.
431
+ - Code blocks are not yet supported in the layout model.
432
+ - Comic books, art albums, primary school textbooks, and exercises cannot be parsed well.
433
+ - Table recognition may result in row/column recognition errors in complex tables.
434
+ - OCR recognition may produce inaccurate characters in PDFs of lesser-known languages (e.g., diacritical marks in Latin script, easily confused characters in Arabic script).
435
+ - Some formulas may not render correctly in Markdown.
394
436
 
395
437
  # FAQ
396
438
 
@@ -416,25 +458,29 @@ This project currently uses PyMuPDF to achieve advanced functionality. However,
416
458
  - [StructEqTable](https://github.com/UniModal4Reasoning/StructEqTable-Deploy)
417
459
  - [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
418
460
  - [PyMuPDF](https://github.com/pymupdf/PyMuPDF)
461
+ - [layoutreader](https://github.com/ppaanngggg/layoutreader)
419
462
  - [fast-langdetect](https://github.com/LlmKira/fast-langdetect)
420
463
  - [pdfminer.six](https://github.com/pdfminer/pdfminer.six)
421
464
 
422
465
  # Citation
423
466
 
424
467
  ```bibtex
468
+ @misc{wang2024mineruopensourcesolutionprecise,
469
+ title={MinerU: An Open-Source Solution for Precise Document Content Extraction},
470
+ author={Bin Wang and Chao Xu and Xiaomeng Zhao and Linke Ouyang and Fan Wu and Zhiyuan Zhao and Rui Xu and Kaiwen Liu and Yuan Qu and Fukai Shang and Bo Zhang and Liqun Wei and Zhihao Sui and Wei Li and Botian Shi and Yu Qiao and Dahua Lin and Conghui He},
471
+ year={2024},
472
+ eprint={2409.18839},
473
+ archivePrefix={arXiv},
474
+ primaryClass={cs.CV},
475
+ url={https://arxiv.org/abs/2409.18839},
476
+ }
477
+
425
478
  @article{he2024opendatalab,
426
479
  title={Opendatalab: Empowering general artificial intelligence with open datasets},
427
480
  author={He, Conghui and Li, Wei and Jin, Zhenjiang and Xu, Chao and Wang, Bin and Lin, Dahua},
428
481
  journal={arXiv preprint arXiv:2407.13773},
429
482
  year={2024}
430
483
  }
431
-
432
- @misc{2024mineru,
433
- title={MinerU: A One-stop, Open-source, High-quality Data Extraction Tool},
434
- author={MinerU Contributors},
435
- howpublished = {\url{https://github.com/opendatalab/MinerU}},
436
- year={2024}
437
- }
438
484
  ```
439
485
 
440
486
  # Star History
@@ -1,11 +1,29 @@
1
1
  magic_pdf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- magic_pdf/pdf_parse_by_ocr.py,sha256=IWnSWt1Z-d35xRqspzdLR2iUtma_SAu4W7K4kEk8SHc,638
3
- magic_pdf/pdf_parse_by_txt.py,sha256=KUSH7Gh83CZmdyWw59pqDskwyJ2Kg-jU-9fnQGJQEs4,537
2
+ magic_pdf/pdf_parse_by_ocr.py,sha256=E-AYHUXjzorFli0CEtmnAi09SI2STJ7FX58yjU0c9PI,810
3
+ magic_pdf/pdf_parse_by_txt.py,sha256=YeFYVAdfwF1CXOHq0LVE5131nqPHA14nt5t_sb-CMMk,709
4
4
  magic_pdf/pdf_parse_union_core.py,sha256=AGIrP7ahc6Ycku0PxAlbjZhwqsdJ8iuRPIn-PFASKWY,11772
5
- magic_pdf/user_api.py,sha256=gzmUHOYlmqPtuw1eZ3Qe2VZCG29v403oN0DURbEsyS8,3417
5
+ magic_pdf/pdf_parse_union_core_v2.py,sha256=18V8aYLz0gLQSMxGJDgUCWSltr15L8s8ClNqB17DNvw,23647
6
+ magic_pdf/user_api.py,sha256=gM-3RQYc6pMEsVvEPFXfWf5RBjAvHcUccugL6fXpP_U,3991
7
+ magic_pdf/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ magic_pdf/config/enums.py,sha256=CImYuw4sbKpq9zrj6zrrEvtdoGkjxDt8S8ByNVDpypU,89
9
+ magic_pdf/config/exceptions.py,sha256=87UX7gyUpj4HqjPcz2hLqdnYeImtDQAxOxj8oXZ_zkE,622
10
+ magic_pdf/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
+ magic_pdf/data/dataset.py,sha256=n8rGw1-wizABR8giSk_XWPCXzx3478u5DK2Z0wOCOeI,5089
12
+ magic_pdf/data/read_api.py,sha256=3fKLsEYAow5RwAmGFMMgvcCh0-_WEEHem2uewukjXOA,3570
13
+ magic_pdf/data/schemas.py,sha256=oIUTBzK8Wq8Wuy8A_uilWAbVhucRvOs9_f3lSKYgcmQ,664
14
+ magic_pdf/data/utils.py,sha256=dJZiqygwNier0UG5tbt5jAPjgwcnfsAN6-m-G1kVPLQ,917
15
+ magic_pdf/data/data_reader_writer/__init__.py,sha256=QtevUaeSivv9dQKi3Tomfn4Z0E4To0cB8qXTnglxaHc,705
16
+ magic_pdf/data/data_reader_writer/base.py,sha256=gUrHCMTHYBrWpqgHdIc-hN7HHwUC2ApK_VXrDUrnfdg,1320
17
+ magic_pdf/data/data_reader_writer/filebase.py,sha256=21RYy4m9MqJGqwd2HWICQJHM-PZXp7UYETCQQK390Kk,1988
18
+ magic_pdf/data/data_reader_writer/multi_bucket_s3.py,sha256=_HA8NJO1Be7KwozlwOJ90o8Ik2vfjlvlDPXppESeIfk,5885
19
+ magic_pdf/data/data_reader_writer/s3.py,sha256=9Oy1cNuXMwG1e8PgZ7AR-pn_MqHAhkgAGnyEZCYoYAA,2408
20
+ magic_pdf/data/io/__init__.py,sha256=WKaIlu8i5AWYxFCGNJcorAfMnlUQDOF8CX07Ycfnu2c,294
21
+ magic_pdf/data/io/base.py,sha256=SqNQqe30ZvoVvg7GVv-hLMCjN6yBgDyQQWeLgGsTfhQ,1118
22
+ magic_pdf/data/io/http.py,sha256=XlKB0DNf4a_uUnfgcclvaaOtmE7lmddx0DnK8A-emAM,958
23
+ magic_pdf/data/io/s3.py,sha256=hyA7sbNriQy64xd_uyJ7acN_oneQ1Pdmoc7_xcvkue8,3606
6
24
  magic_pdf/dict2md/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
25
  magic_pdf/dict2md/mkcontent.py,sha256=rWUY-2opd0jeowEUEVOV_uWcKum1Q7ng4nOoT6-ka_s,17459
8
- magic_pdf/dict2md/ocr_mkcontent.py,sha256=YILNQm8Nq1VMpgKTGF_fRNEzkrEg1aQKHxWI0lVQucI,18565
26
+ magic_pdf/dict2md/ocr_mkcontent.py,sha256=ClxKUwrK7wlXKCcDfuTryztKl5e8pzcnh5x_fODFm2U,12928
9
27
  magic_pdf/filter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
28
  magic_pdf/filter/pdf_classify_by_type.py,sha256=spmDO-f2ihAl1d6-EP-j271Yi50oyu6mw4X2kRd_m0s,42320
11
29
  magic_pdf/filter/pdf_meta_scan.py,sha256=5R2XDiBZw0xd4ugbDxuyk6fztGlT5jFsGN85hLvo-hQ,17390
@@ -20,18 +38,19 @@ magic_pdf/layout/layout_det_utils.py,sha256=NCYBTvsrULE3Cue53aMD1MfXTmOL9Xy0nivl
20
38
  magic_pdf/layout/layout_sort.py,sha256=jtacQVcxnuYAksvEqtS0DH-v6U8qyjX-jmyZgDJ-egA,37005
21
39
  magic_pdf/layout/layout_spiler_recog.py,sha256=QjBSgB-a7J2yjUR1eaCs9ZD7URtiRnV6W934hpAeuC4,3067
22
40
  magic_pdf/layout/mcol_sort.py,sha256=ADnLisBJBHXDKYChcf2lzTb_TC_vZ4q89_CSN8mwEJc,11331
23
- magic_pdf/libs/Constants.py,sha256=rdJVadmgN0UlIB-xcMQ9j7Qk9q1Qahxt3KEY-vL7hSU,774
24
- magic_pdf/libs/MakeContentConfig.py,sha256=UDZPpsv8q4DqTy8h0vRtrT2kHqWiVI205VnVhlUEQc0,206
41
+ magic_pdf/libs/Constants.py,sha256=u9i-ivxxcGp7Hu_zvrLA1jdPcEnYhPb7wXOSUaOSwGQ,1140
42
+ magic_pdf/libs/MakeContentConfig.py,sha256=Do5VKNQp3gfUKyhrZStfzfBj7l-vbsYpsJFF1SsmEc0,248
25
43
  magic_pdf/libs/ModelBlockTypeEnum.py,sha256=kalXPbo5ya6hKhhBHPGlHl1yjWOURoXZWQM3rVUyPsY,164
26
44
  magic_pdf/libs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
- magic_pdf/libs/boxbase.py,sha256=YGIVYWBHyBSopcTxd5e3FVw6QQUnRMzyYgFJmcEl4Hc,15842
45
+ magic_pdf/libs/boxbase.py,sha256=ELMHWolgWROxOAQDgwmL7VS5kveZp4ifvEzRmPul2Ws,16925
28
46
  magic_pdf/libs/calc_span_stats.py,sha256=5vnU27DcbkFDRSAoLqAmX0KQ3I9ehWkEgh_t9hxg_zI,10147
47
+ magic_pdf/libs/clean_memory.py,sha256=BIOmEWuwR7c_p4OwTSW2muE3PRaGhmOplS-wTXt_EXk,211
29
48
  magic_pdf/libs/commons.py,sha256=6Zu9-OyamyCNDY7qj0SxR-rux-ggj9im3CVPtC4ubB8,7108
30
- magic_pdf/libs/config_reader.py,sha256=dPx6JJJuCw9AzNgKtrTG1elmfdeN6gDhgFK9r15-NsE,2505
49
+ magic_pdf/libs/config_reader.py,sha256=0uMOTSZE2crvqdGj2j21tlwV0nNRZha44Y9X98gQ3AQ,4067
31
50
  magic_pdf/libs/convert_utils.py,sha256=Ov-lsfCLBPz_15iSJXIslBNmrSf_E_1g_XDWJy8NgO8,143
32
51
  magic_pdf/libs/coordinate_transform.py,sha256=Bbop2cP2uz2ZG0U0gwd7J6EKkgABq5Rv03qf2LMPw80,429
33
52
  magic_pdf/libs/detect_language_from_model.py,sha256=Uln8F9qs8EJOw4EgI7KRlaU3lD_mK8KMTlADLFtz8fk,816
34
- magic_pdf/libs/draw_bbox.py,sha256=sbpN4LJ19k5Fh4NsY79mrLEc1-9XIoyoZJb9hL9A5b4,13703
53
+ magic_pdf/libs/draw_bbox.py,sha256=J_RaG6sRkqNyUd75NiWbDk-3LIE8es-zNIbcwR9myvo,17196
35
54
  magic_pdf/libs/drop_reason.py,sha256=IfjPSrPLMmVziqjOXPep7r_ioQKFRahDgbOW1SD-Tuw,2148
36
55
  magic_pdf/libs/drop_tag.py,sha256=bZDg3bIVWvBT1Ec1icwj5WLOkt5-hI6eRYZ2tX9_a74,673
37
56
  magic_pdf/libs/hash_utils.py,sha256=VEKK9WfFoZgrPfi8kfITjLpr8Ahufs8tXh9R1Y5lAL8,404
@@ -40,21 +59,21 @@ magic_pdf/libs/language.py,sha256=Hj5-lrGoNExxdHLbkcNG-c27U4AjJ9AZPdZblaNSehU,10
40
59
  magic_pdf/libs/local_math.py,sha256=tqljQOgqh3fZc146HYhO88JXJaiXMVwArBkk_CSGICc,177
41
60
  magic_pdf/libs/markdown_utils.py,sha256=cLxLXjRhrNp_wCHvtglrGA_FVdrvfd1KULeTtj1p18w,944
42
61
  magic_pdf/libs/nlp_utils.py,sha256=-X9W3-Ns5ZdDYFvyyEq6i6P2b5hCATaFEZeOjwNOH9M,6901
43
- magic_pdf/libs/ocr_content_type.py,sha256=xpPF5Unhiw9hPVlgsvPtFPpi7ReJo5dvZevluE3lfPc,852
62
+ magic_pdf/libs/ocr_content_type.py,sha256=e_7RBTdShaWvWhMO2SFou7GM521elMH_Jtn5usbHWdY,890
44
63
  magic_pdf/libs/path_utils.py,sha256=Hykw_l5CU736b2egHV9P7B-qh3QNKO4nZSGCbsi0Z8E,1043
45
64
  magic_pdf/libs/pdf_check.py,sha256=MAe8wzwT0qvPf_I72wEZG7k1g4haNHS7oUtLqkB5rlE,2145
46
65
  magic_pdf/libs/pdf_image_tools.py,sha256=CAd01giTKr_UJz1_QtDOARG9G9z69GFpzRZwcWSfLtE,1282
47
66
  magic_pdf/libs/safe_filename.py,sha256=ckwcM_eqoysTb5id8czp-tXq2G9da0-l3pshZDCHQtE,236
48
67
  magic_pdf/libs/textbase.py,sha256=SC1Frhz3Fb7V7n2SFRBsl7Bmg0JZdlvZskq0lfW1vIk,732
49
- magic_pdf/libs/version.py,sha256=Ocl79hbbH8_jdr5dGC90VR1cAvZc05Rc0tkZttUnMjo,22
68
+ magic_pdf/libs/version.py,sha256=UwJXM8JY2T3tE2id0K2k_lEaVThbRTrGO1mNibyzIz8,22
50
69
  magic_pdf/libs/vis_utils.py,sha256=hTOTEakKV0pGMbk0tbRkVI_tku7A3dGc96ynObZ4kwI,10207
51
70
  magic_pdf/model/__init__.py,sha256=1QcfMKET0xQhSaZMjNQHi_TjzSSDR6PI5mjkmaXHPe8,52
52
- magic_pdf/model/doc_analyze_by_custom_model.py,sha256=Ht1zZAB4WV3b-AWdRV5m5fuidlD6ZhNkvJM0j9i1l_E,4809
53
- magic_pdf/model/magic_model.py,sha256=afSd9D0S31uEAseY98rJrL9BybBMeSMm5jbeWoWuWWo,30694
71
+ magic_pdf/model/doc_analyze_by_custom_model.py,sha256=eYrtOIlFqw8O95ShoCTaAhLBHk7TXc5DGif93VikW4s,6977
72
+ magic_pdf/model/magic_model.py,sha256=RKJOruUGAV1lHcGqSlCDbkJn5kutb3fphDreOHASPQg,43505
54
73
  magic_pdf/model/model_list.py,sha256=tJ9jtMB93HGx8Rmt8wmQSDFXZBUIPQrwaaYsep4luTM,183
55
- magic_pdf/model/pdf_extract_kit.py,sha256=Bdxqo3AGXs0VByFVj6ZEOm4T6wXTZwkZsRRFtxasNQM,17901
56
- magic_pdf/model/ppTableModel.py,sha256=wWiui9VOjkKYlNX-viPqsWpzgkNJ-9_S2Se-j4oyLqU,2687
57
- magic_pdf/model/pp_structure_v2.py,sha256=1sn8IJK0d5ZmqJ2XFt9FdaSdI0RQf-iwNAWBrVrIeuc,2872
74
+ magic_pdf/model/pdf_extract_kit.py,sha256=7BVcVkrIAI2aTAUHD_Xrq0yAuy4BEAAJEicOM8Hr0Xw,21593
75
+ magic_pdf/model/ppTableModel.py,sha256=fqMuMahN2BW4sKGCgFLsi1X1OFaIG8Dab_eHUhKPcH4,2692
76
+ magic_pdf/model/pp_structure_v2.py,sha256=BKPN7W4BjG0eWPAPjPEac1RMnb5eIzmAz4E4Rq-9b1U,3019
58
77
  magic_pdf/model/pek_sub_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
78
  magic_pdf/model/pek_sub_modules/post_process.py,sha256=HzRxV2sVR3Qo8XKYEHhT6tae-bYTb6dnAfGP6gfVNaM,1135
60
79
  magic_pdf/model/pek_sub_modules/self_modify.py,sha256=NGUr8t4bXSeh38hwrfs6qxhf0IW-f3J96bnrg1xw8BA,14281
@@ -78,8 +97,10 @@ magic_pdf/model/pek_sub_modules/layoutlmv3/layoutlmft/models/layoutlmv3/configur
78
97
  magic_pdf/model/pek_sub_modules/layoutlmv3/layoutlmft/models/layoutlmv3/modeling_layoutlmv3.py,sha256=mdo8tO-DrJcv0Lbk9Pp98n3NQXYOnFFyXQWjU7t35kA,54633
79
98
  magic_pdf/model/pek_sub_modules/layoutlmv3/layoutlmft/models/layoutlmv3/tokenization_layoutlmv3.py,sha256=diKlrfxYjKAmYrUgjYdx-FXLh-swShC3tl-EBX1b3oI,1197
80
99
  magic_pdf/model/pek_sub_modules/layoutlmv3/layoutlmft/models/layoutlmv3/tokenization_layoutlmv3_fast.py,sha256=0lxiG69_fGpSSBYA9CBLnDa_qqa1rInZ0pJpqBwZ0Yw,1372
81
- magic_pdf/model/pek_sub_modules/structeqtable/StructTableModel.py,sha256=C9WluPhwaqsFg154WsNxN2HlhFXVkAAw0prR7t8r5J4,918
100
+ magic_pdf/model/pek_sub_modules/structeqtable/StructTableModel.py,sha256=qQthlYDvDPah1mzzrnKXU4fYqlJdXOPBnJ8tYf-o_0k,1384
82
101
  magic_pdf/model/pek_sub_modules/structeqtable/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
+ magic_pdf/model/v3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
103
+ magic_pdf/model/v3/helpers.py,sha256=IVUFcNMDF3-kio-BIxjppHnWS3eHPqvvNihIw2fbIFM,4372
83
104
  magic_pdf/para/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
84
105
  magic_pdf/para/block_continuation_processor.py,sha256=IkReB5hirjm0OAirNzQQpnWe2f2bdP3Hug3Ef8qTRDA,22749
85
106
  magic_pdf/para/block_termination_processor.py,sha256=YU3ZYqJy9e3OQmOuQYZrR6AUpmAlQ0mhj0PgZZPZ_fM,17957
@@ -91,13 +112,14 @@ magic_pdf/para/layout_match_processor.py,sha256=yr4FEO7GJ502udShqGRqIJQ_FQxoa0aG
91
112
  magic_pdf/para/para_pipeline.py,sha256=zLaCHI9jLi1UPzh0lHP44mUjpKVTHS0gE_5YrkjVqEY,11796
92
113
  magic_pdf/para/para_split.py,sha256=-UJM2jREW_2h3ZlJAU7dRD8bK3CMGKuhJrfgqv3Auvk,31310
93
114
  magic_pdf/para/para_split_v2.py,sha256=ZIiLzpvVL364x1zcEG9IbT6ARJ-6JnWLIVrsDmf4w1M,36878
115
+ magic_pdf/para/para_split_v3.py,sha256=k02I9Rdc8jfYr3bMT_Gm38b5ginkl-ZIU5C_XcfAcs8,14704
94
116
  magic_pdf/para/raw_processor.py,sha256=mHxD9FrdOSXH7NqM41s55URyCyuyACvm9kKtowkIb3k,6317
95
117
  magic_pdf/para/stats.py,sha256=-6Pf9Y8jkP1uJOYWiHUjw9Lb-Fb9GY7MHr_ok7x2GX0,9731
96
118
  magic_pdf/para/title_processor.py,sha256=pYZv9vEkIjAtCz8jIUtl9AVUy_ib5SdAZmMVoZtsMRI,38593
97
- magic_pdf/pipe/AbsPipe.py,sha256=btbCoH30x5ECzOwoYdMn-MQQPhMOB6IaoDriC0M5oe8,4265
98
- magic_pdf/pipe/OCRPipe.py,sha256=rCff7CPMLDGDzF4SfaLKeUk-6PNXVkzWRo96hS7XqSM,1605
99
- magic_pdf/pipe/TXTPipe.py,sha256=AiO6yAq8XpT66jP3bMaNH2L97y3jRr10xQFbx5VzrxE,1664
100
- magic_pdf/pipe/UNIPipe.py,sha256=X8paSZTvxgKHxUcVLB2LFMoPhdk215zHKXSNOSGOjeg,4101
119
+ magic_pdf/pipe/AbsPipe.py,sha256=jpJD-8S5K89bCxI4FY2_tMKGV1lghlbtmpOeJXqEhz0,4487
120
+ magic_pdf/pipe/OCRPipe.py,sha256=TswwfMkAYP-fpfsBoNIArtcCoNEqzCQCVWfwR4n8G-E,2159
121
+ magic_pdf/pipe/TXTPipe.py,sha256=zcsiOreOHJBtaeYgEc5yGKMSiNzBED8HcsD7NGu5RaY,2218
122
+ magic_pdf/pipe/UNIPipe.py,sha256=3ytYHoyTboHUGlRQpfyITiAP_mYXTOBjqy7wYHoUHpE,4944
101
123
  magic_pdf/pipe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
124
  magic_pdf/post_proc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
103
125
  magic_pdf/post_proc/detect_para.py,sha256=5LX86ueHQGOV9CNimAxqZH4R3KTi78leum1de_Na0pw,126181
@@ -119,9 +141,9 @@ magic_pdf/pre_proc/equations_replace.py,sha256=fXj7ZV7F3YtkDYrAhE9g5tHk4_3pVUyLb
119
141
  magic_pdf/pre_proc/fix_image.py,sha256=5MOfkXc8abfIp49g-68vll40wwTUZ5tcQ2gtsJuFmvs,11486
120
142
  magic_pdf/pre_proc/fix_table.py,sha256=20sqJe27fAXcL7_C0qQ9mpsggmH37WuX-wPYWyRgACA,13227
121
143
  magic_pdf/pre_proc/main_text_font.py,sha256=1gkjvPuBdKC4oVFkLvnRm2zghsLtVlfAEMKXouyVonM,1048
122
- magic_pdf/pre_proc/ocr_detect_all_bboxes.py,sha256=vFT3bsqQ2_GvcYeFS4J4UQCxxwgEUFk5x3TxId6m8BE,7110
144
+ magic_pdf/pre_proc/ocr_detect_all_bboxes.py,sha256=omR2aOQNerKmKUF13CFP5-Z6Hv4GZztmsAQgLpHiugc,11341
123
145
  magic_pdf/pre_proc/ocr_detect_layout.py,sha256=DW0_HXzmcbW22cXKIYFsyZNFh8mEjSHXIFVjXndJsvQ,5878
124
- magic_pdf/pre_proc/ocr_dict_merge.py,sha256=8t81fXGHdVuJ5-AEKdyx3Q7JH3OMSNZ-GgsYWHl_VjE,13118
146
+ magic_pdf/pre_proc/ocr_dict_merge.py,sha256=KyXSW36lJ1PsK816J55vVQQtXTWODX1xG1_DvA7pOSo,14248
125
147
  magic_pdf/pre_proc/ocr_span_list_modify.py,sha256=jqBheXF8EuYCfS9tn6typr-aE57nfMoeBC36J5GjpbQ,11519
126
148
  magic_pdf/pre_proc/pdf_pre_filter.py,sha256=FIMwe8Lei9LI2RmkqiaSyTHV5b7ViADbpyBwgVwZH-c,2687
127
149
  magic_pdf/pre_proc/post_layout_split.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -133,8 +155,8 @@ magic_pdf/pre_proc/resolve_bbox_conflict.py,sha256=bJiegofPUeDyi--oZjfipQ5Q5RLm6
133
155
  magic_pdf/pre_proc/solve_line_alien.py,sha256=aNoQptPcC38Sm1I2ABhgw8jeH_5kjsRHx3VYlFFtm1g,853
134
156
  magic_pdf/pre_proc/statistics.py,sha256=_9jGlXq0iXd03UMxB92ZqCiu7cjNkG5vHvFlTF_9ytA,220
135
157
  magic_pdf/resources/fasttext-langdetect/lid.176.ftz,sha256=jzRyz-hzintgmejpmcPL-uDc0VaWqsfXc4qAOdtgPoM,938013
136
- magic_pdf/resources/model_config/model_configs.yaml,sha256=_gOSxK9jxe1bFwtH_uwovsyZnRi1sEVNYb1OAexDmF4,301
137
- magic_pdf/resources/model_config/UniMERNet/demo.yaml,sha256=al9_--m3n2j9zEn9OjlmmpfQbqVBAYFakXc_hY4vDXo,807
158
+ magic_pdf/resources/model_config/model_configs.yaml,sha256=muwPuO6C8Z5oEStE-wWEt7vmkenmJiqTbkRfUfle_vU,257
159
+ magic_pdf/resources/model_config/UniMERNet/demo.yaml,sha256=Jdaim2D2lAYrV9rhc1X5Sy2_IacGOrfysJhxEUgSElo,827
138
160
  magic_pdf/resources/model_config/layoutlmv3/layoutlmv3_base_inference.yaml,sha256=9aNAEYgpHTAWpcUrDvuPG2y4V-Qw8QdcJefi96y8yDU,6109
139
161
  magic_pdf/rw/AbsReaderWriter.py,sha256=2H5SDJfAAOX9kPfel06a8VRCHxD1Y8aPbWEkQDdn9JM,452
140
162
  magic_pdf/rw/DiskReaderWriter.py,sha256=7ZAekH8V6xlBo_1WeSZ6sNwAj2WGPtjNl50zq1CoMDY,2614
@@ -143,12 +165,14 @@ magic_pdf/rw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
143
165
  magic_pdf/spark/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
144
166
  magic_pdf/spark/spark_api.py,sha256=eSLXTjMYW5Ya41VMIApRVfji1ZxEZXdH9ZdsL6fy5Kw,1131
145
167
  magic_pdf/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
146
- magic_pdf/tools/cli.py,sha256=tUeJhGudJIrCDMNQDRTWtNGE_4E0TWpKTuEkf5y_2uk,2734
168
+ magic_pdf/tools/cli.py,sha256=yl2E-DYxBN3XF7bWOBseYxptbmeE7tXWpwV-sp2aGIE,3140
147
169
  magic_pdf/tools/cli_dev.py,sha256=3e5eyCQEt_EujXZu5fUAWr_W-YQQVqS9pB0Qgw7t1D8,4122
148
- magic_pdf/tools/common.py,sha256=2KsqN0rNcuyt9B3vAoF-HeeiwdJbO3iO5VE1zBZ1VCw,4859
149
- magic_pdf-0.8.1.dist-info/LICENSE.md,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
150
- magic_pdf-0.8.1.dist-info/METADATA,sha256=fWU35cJWoz62IWXDGIC3PsTDIz_vgV_orr1eEjvjjaQ,34142
151
- magic_pdf-0.8.1.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
152
- magic_pdf-0.8.1.dist-info/entry_points.txt,sha256=wXwYke3j8fqDQTocUspL-CqDUEv3Tfcwp09fM8dZAhA,98
153
- magic_pdf-0.8.1.dist-info/top_level.txt,sha256=J9I0AzmHWGkp9c6DL8Oe4mEx3yYphLzkRn4H25Lg1rE,10
154
- magic_pdf-0.8.1.dist-info/RECORD,,
170
+ magic_pdf/tools/common.py,sha256=2S8N60pcA6bFqAmdchoEmn22l9ntQxEfyaKpxfCKJ-Y,5465
171
+ magic_pdf/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
172
+ magic_pdf/utils/annotations.py,sha256=82ou3uELNbQWa9hOFFkVt0gsIskAKf5msCv5J2IJ5V0,211
173
+ magic_pdf-0.9.1.dist-info/LICENSE.md,sha256=jVa0BUaKrRH4erV2P5AeJ24I2WRv9chIGxditreJ6e0,34524
174
+ magic_pdf-0.9.1.dist-info/METADATA,sha256=2NLbuQt-GzeMws3412i4A8XaDr8xuMZBymu7n3XY7S0,39624
175
+ magic_pdf-0.9.1.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
176
+ magic_pdf-0.9.1.dist-info/entry_points.txt,sha256=wXwYke3j8fqDQTocUspL-CqDUEv3Tfcwp09fM8dZAhA,98
177
+ magic_pdf-0.9.1.dist-info/top_level.txt,sha256=J9I0AzmHWGkp9c6DL8Oe4mEx3yYphLzkRn4H25Lg1rE,10
178
+ magic_pdf-0.9.1.dist-info/RECORD,,