magic-pdf 0.6.2b1__py3-none-any.whl → 0.7.0b1__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 (33) hide show
  1. magic_pdf/dict2md/ocr_mkcontent.py +10 -3
  2. magic_pdf/libs/Constants.py +4 -1
  3. magic_pdf/libs/config_reader.py +10 -10
  4. magic_pdf/libs/draw_bbox.py +66 -1
  5. magic_pdf/libs/ocr_content_type.py +14 -0
  6. magic_pdf/libs/version.py +1 -1
  7. magic_pdf/model/doc_analyze_by_custom_model.py +10 -4
  8. magic_pdf/model/magic_model.py +4 -0
  9. magic_pdf/model/pdf_extract_kit.py +83 -39
  10. magic_pdf/model/pek_sub_modules/structeqtable/StructTableModel.py +22 -0
  11. magic_pdf/resources/model_config/model_configs.yaml +4 -0
  12. magic_pdf/rw/AbsReaderWriter.py +1 -18
  13. magic_pdf/rw/DiskReaderWriter.py +32 -24
  14. magic_pdf/rw/S3ReaderWriter.py +83 -48
  15. magic_pdf/tools/cli.py +79 -0
  16. magic_pdf/tools/cli_dev.py +155 -0
  17. magic_pdf/tools/common.py +122 -0
  18. magic_pdf-0.7.0b1.dist-info/METADATA +421 -0
  19. {magic_pdf-0.6.2b1.dist-info → magic_pdf-0.7.0b1.dist-info}/RECORD +25 -27
  20. {magic_pdf-0.6.2b1.dist-info → magic_pdf-0.7.0b1.dist-info}/WHEEL +1 -1
  21. magic_pdf-0.7.0b1.dist-info/entry_points.txt +3 -0
  22. magic_pdf/cli/magicpdf.py +0 -359
  23. magic_pdf/pdf_parse_for_train.py +0 -685
  24. magic_pdf/train_utils/convert_to_train_format.py +0 -65
  25. magic_pdf/train_utils/extract_caption.py +0 -59
  26. magic_pdf/train_utils/remove_footer_header.py +0 -159
  27. magic_pdf/train_utils/vis_utils.py +0 -327
  28. magic_pdf-0.6.2b1.dist-info/METADATA +0 -344
  29. magic_pdf-0.6.2b1.dist-info/entry_points.txt +0 -2
  30. /magic_pdf/{cli → model/pek_sub_modules/structeqtable}/__init__.py +0 -0
  31. /magic_pdf/{train_utils → tools}/__init__.py +0 -0
  32. {magic_pdf-0.6.2b1.dist-info → magic_pdf-0.7.0b1.dist-info}/LICENSE.md +0 -0
  33. {magic_pdf-0.6.2b1.dist-info → magic_pdf-0.7.0b1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,421 @@
1
+ Metadata-Version: 2.1
2
+ Name: magic-pdf
3
+ Version: 0.7.0b1
4
+ Summary: A practical tool for converting PDF to Markdown
5
+ Home-page: https://github.com/opendatalab/MinerU
6
+ Requires-Python: >=3.9
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE.md
9
+ Requires-Dist: boto3>=1.28.43
10
+ Requires-Dist: Brotli>=1.1.0
11
+ Requires-Dist: click>=8.1.7
12
+ Requires-Dist: PyMuPDF>=1.24.9
13
+ Requires-Dist: loguru>=0.6.0
14
+ Requires-Dist: numpy<2.0.0,>=1.21.6
15
+ Requires-Dist: fast-langdetect==0.2.0
16
+ Requires-Dist: wordninja>=2.0.0
17
+ Requires-Dist: scikit-learn>=1.0.2
18
+ Requires-Dist: pdfminer.six==20231228
19
+ Provides-Extra: full
20
+ Requires-Dist: unimernet==0.1.6; extra == "full"
21
+ Requires-Dist: ultralytics; extra == "full"
22
+ Requires-Dist: paddleocr==2.7.3; extra == "full"
23
+ Requires-Dist: pypandoc; extra == "full"
24
+ Requires-Dist: struct-eqtable==0.1.0; extra == "full"
25
+ Requires-Dist: detectron2; extra == "full"
26
+ Requires-Dist: paddlepaddle==3.0.0b1; platform_system == "Linux" and extra == "full"
27
+ Requires-Dist: matplotlib; (platform_system == "Linux" or platform_system == "Darwin") and extra == "full"
28
+ Requires-Dist: matplotlib<=3.9.0; platform_system == "Windows" and extra == "full"
29
+ Requires-Dist: paddlepaddle==2.6.1; (platform_system == "Windows" or platform_system == "Darwin") and extra == "full"
30
+ Provides-Extra: lite
31
+ Requires-Dist: paddleocr==2.7.3; extra == "lite"
32
+ Requires-Dist: paddlepaddle==3.0.0b1; platform_system == "Linux" and extra == "lite"
33
+ Requires-Dist: paddlepaddle==2.6.1; (platform_system == "Windows" or platform_system == "Darwin") and extra == "lite"
34
+
35
+ <div align="center" xmlns="http://www.w3.org/1999/html">
36
+ <!-- logo -->
37
+ <p align="center">
38
+ <img src="docs/images/MinerU-logo.png" width="300px" style="vertical-align:middle;">
39
+ </p>
40
+
41
+ <!-- icon -->
42
+ [![stars](https://img.shields.io/github/stars/opendatalab/MinerU.svg)](https://github.com/opendatalab/MinerU)
43
+ [![forks](https://img.shields.io/github/forks/opendatalab/MinerU.svg)](https://github.com/opendatalab/MinerU)
44
+ [![open issues](https://img.shields.io/github/issues-raw/opendatalab/MinerU)](https://github.com/opendatalab/MinerU/issues)
45
+ [![issue resolution](https://img.shields.io/github/issues-closed-raw/opendatalab/MinerU)](https://github.com/opendatalab/MinerU/issues)
46
+ [![PyPI version](https://badge.fury.io/py/magic-pdf.svg)](https://badge.fury.io/py/magic-pdf)
47
+ [![Downloads](https://static.pepy.tech/badge/magic-pdf)](https://pepy.tech/project/magic-pdf)
48
+ [![Downloads](https://static.pepy.tech/badge/magic-pdf/month)](https://pepy.tech/project/magic-pdf)
49
+ <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>
50
+
51
+ <!-- language -->
52
+ [English](README.md) | [简体中文](README_zh-CN.md)
53
+
54
+ <!-- hot link -->
55
+ <p align="center">
56
+ <a href="https://github.com/opendatalab/PDF-Extract-Kit">PDF-Extract-Kit: High-Quality PDF Extraction Toolkit</a>🔥🔥🔥
57
+ </p>
58
+
59
+ <!-- join us -->
60
+ <p align="center">
61
+ 👋 join us on <a href="https://discord.gg/Tdedn9GTXq" target="_blank">Discord</a> and <a href="https://cdn.vansin.top/internlm/mineru.jpg" target="_blank">WeChat</a>
62
+ </p>
63
+
64
+ </div>
65
+
66
+ # Changelog
67
+ - 2024/08/09: Version 0.7.0b1 released, simplified installation process, added table recognition functionality
68
+ - 2024/08/01: Version 0.6.2b1 released, optimized dependency conflict issues and installation documentation
69
+ - 2024/07/05: Initial open-source release
70
+
71
+ <!-- TABLE OF CONTENT -->
72
+ <details open="open">
73
+ <summary><h2 style="display: inline-block">Table of Contents</h2></summary>
74
+ <ol>
75
+ <li>
76
+ <a href="#mineru">MinerU</a>
77
+ <ul>
78
+ <li><a href="#project-introduction">Project Introduction</a></li>
79
+ <li><a href="#key-features">Key Features</a></li>
80
+ <li><a href="#quick-start">Quick Start</a>
81
+ <ul>
82
+ <li><a href="#online-demo">Online Demo</a></li>
83
+ <li><a href="#quick-cpu-demo">Quick CPU Demo</a></li>
84
+ <li><a href="#using-gpu">Using GPU</a></li>
85
+ </ul>
86
+ </li>
87
+ <li><a href="#usage">Usage</a>
88
+ <ul>
89
+ <li><a href="#command-line">Command Line</a></li>
90
+ <li><a href="#api">API</a></li>
91
+ <li><a href="#development-guide">Development Guide</a></li>
92
+ </ul>
93
+ </li>
94
+ </ul>
95
+ </li>
96
+ <li><a href="#todo">TODO</a></li>
97
+ <li><a href="#known-issues">Known Issues</a></li>
98
+ <li><a href="#faq">FAQ</a></li>
99
+ <li><a href="#all-thanks-to-our-contributors">All Thanks To Our Contributors</a></li>
100
+ <li><a href="#license-information">License Information</a></li>
101
+ <li><a href="#acknowledgments">Acknowledgments</a></li>
102
+ <li><a href="#citation">Citation</a></li>
103
+ <li><a href="#star-history">Star History</a></li>
104
+ <li><a href="#magic-doc">Magic-doc</a></li>
105
+ <li><a href="#magic-html">Magic-html</a></li>
106
+ <li><a href="#links">Links</a></li>
107
+ </ol>
108
+ </details>
109
+
110
+
111
+
112
+ # MinerU
113
+ ## Project Introduction
114
+ MinerU is a tool that converts PDFs into machine-readable formats (e.g., markdown, JSON), allowing for easy extraction into any format.
115
+ MinerU was born during the pre-training process of [InternLM](https://github.com/InternLM/InternLM). We focus on solving symbol conversion issues in scientific literature and hope to contribute to technological development in the era of large models.
116
+ Compared to well-known commercial products, MinerU is still young. If you encounter any issues or if the results are not as expected, please submit an issue on [issue](https://github.com/opendatalab/MinerU/issues) and **attach the relevant PDF**.
117
+
118
+ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
119
+
120
+ ## Key Features
121
+
122
+ - Removes elements such as headers, footers, footnotes, and page numbers while maintaining semantic continuity
123
+ - Outputs text in a human-readable order from multi-column documents
124
+ - Retains the original structure of the document, including titles, paragraphs, and lists
125
+ - Extracts images, image captions, tables, and table captions
126
+ - Automatically recognizes formulas in the document and converts them to LaTeX
127
+ - Automatically recognizes tables in the document and converts them to LaTeX
128
+ - Automatically detects and enables OCR for corrupted PDFs
129
+ - Supports both CPU and GPU environments
130
+ - Supports Windows, Linux, and Mac platforms
131
+
132
+ ## Quick Start
133
+
134
+ If you encounter any installation issues, please first consult the <a href="#faq">FAQ</a>. </br>
135
+ If the parsing results are not as expected, refer to the <a href="#known-issues">Known Issues</a>. </br>
136
+ There are three different ways to experience MinerU:
137
+ - [Online Demo (No Installation Required)](#online-demo)
138
+ - [Quick CPU Demo (Windows, Linux, Mac)](#quick-cpu-demo)
139
+ - [Linux/Windows + CUDA](#Using-GPU)
140
+
141
+ **⚠️ Pre-installation Notice—Hardware and Software Environment Support**
142
+
143
+ To ensure the stability and reliability of the project, we only optimize and test for specific hardware and software environments during development. This ensures that users deploying and running the project on recommended system configurations will get the best performance with the fewest compatibility issues.
144
+
145
+ By focusing resources on the mainline environment, our team can more efficiently resolve potential bugs and develop new features.
146
+
147
+ In non-mainline environments, due to the diversity of hardware and software configurations, as well as third-party dependency compatibility issues, we cannot guarantee 100% project availability. Therefore, for users who wish to use this project in non-recommended environments, we suggest carefully reading the documentation and FAQ first. Most issues already have corresponding solutions in the FAQ. We also encourage community feedback to help us gradually expand support.
148
+
149
+ <table>
150
+ <tr>
151
+ <td colspan="3" rowspan="2">Operating System</td>
152
+ </tr>
153
+ <tr>
154
+ <td>Ubuntu 22.04 LTS</td>
155
+ <td>Windows 10 / 11</td>
156
+ <td>macOS 11+</td>
157
+ </tr>
158
+ <tr>
159
+ <td colspan="3">CPU</td>
160
+ <td>x86_64</td>
161
+ <td>x86_64</td>
162
+ <td>x86_64 / arm64</td>
163
+ </tr>
164
+ <tr>
165
+ <td colspan="3">Memory</td>
166
+ <td colspan="3">16GB or more, recommended 32GB+</td>
167
+ </tr>
168
+ <tr>
169
+ <td colspan="3">Python Version</td>
170
+ <td colspan="3">3.10</td>
171
+ </tr>
172
+ <tr>
173
+ <td colspan="3">Nvidia Driver Version</td>
174
+ <td>latest (Proprietary Driver)</td>
175
+ <td>latest</td>
176
+ <td>None</td>
177
+ </tr>
178
+ <tr>
179
+ <td colspan="3">CUDA Environment</td>
180
+ <td>Automatic installation [12.1 (pytorch) + 11.8 (paddle)]</td>
181
+ <td>11.8 (manual installation) + cuDNN v8.7.0 (manual installation)</td>
182
+ <td>None</td>
183
+ </tr>
184
+ <tr>
185
+ <td rowspan="2">GPU Hardware Support List</td>
186
+ <td colspan="2">Minimum Requirement 8G+ VRAM</td>
187
+ <td colspan="2">3060ti/3070/3080/3080ti/4060/4070/4070ti<br>
188
+ 8G VRAM only enables layout and formula recognition acceleration</td>
189
+ <td rowspan="2">None</td>
190
+ </tr>
191
+ <tr>
192
+ <td colspan="2">Recommended Configuration 16G+ VRAM</td>
193
+ <td colspan="2">3090/3090ti/4070ti super/4080/4090<br>
194
+ 16G or more can enable layout, formula recognition, and OCR acceleration simultaneously</td>
195
+ </tr>
196
+ </table>
197
+
198
+ ### Online Demo
199
+
200
+ [Click here for the online demo](https://opendatalab.com/OpenSourceTools/Extractor/PDF)
201
+
202
+ ### Quick CPU Demo
203
+
204
+ #### 1. Install magic-pdf
205
+ ```bash
206
+ conda create -n MinerU python=3.10
207
+ conda activate MinerU
208
+ pip install magic-pdf[full]==0.7.0b1 --extra-index-url https://wheels.myhloli.com
209
+ ```
210
+ #### 2. Download model weight files
211
+
212
+ Refer to [How to Download Model Files](docs/how_to_download_models_en.md) for detailed instructions.
213
+ > ❗️After downloading the models, please make sure to verify the completeness of the model files.
214
+ >
215
+ > Check if the model file sizes match the description on the webpage. If possible, use sha256 to verify the integrity of the files.
216
+
217
+ #### 3. Copy and configure the template file
218
+ You can find the `magic-pdf.template.json` template configuration file in the root directory of the repository.
219
+ > ❗️Make sure to execute the following command to copy the configuration file to your **user directory**; otherwise, the program will not run.
220
+ >
221
+ > The user directory for Windows is `C:\Users\YourUsername`, for Linux it is `/home/YourUsername`, and for macOS it is `/Users/YourUsername`.
222
+ ```bash
223
+ cp magic-pdf.template.json ~/magic-pdf.json
224
+ ```
225
+
226
+ 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).
227
+ > ❗️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.
228
+ >
229
+ > 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.
230
+ >
231
+ > 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`.
232
+ ```json
233
+ {
234
+ // other config
235
+ "models-dir": "D:/models",
236
+ "table-config": {
237
+ "is_table_recog_enable": false, // Table recognition is disabled by default, modify this value to enable it
238
+ "max_time": 400
239
+ }
240
+ }
241
+ ```
242
+
243
+
244
+ ### Using GPU
245
+ If your device supports CUDA and meets the GPU requirements of the mainline environment, you can use GPU acceleration. Please select the appropriate guide based on your system:
246
+
247
+ - [Ubuntu 22.04 LTS + GPU](docs/README_Ubuntu_CUDA_Acceleration_en_US.md)
248
+ - [Windows 10/11 + GPU](docs/README_Windows_CUDA_Acceleration_en_US.md)
249
+
250
+
251
+ ## Usage
252
+
253
+ ### Command Line
254
+
255
+ ```bash
256
+ magic-pdf --help
257
+ Usage: magic-pdf [OPTIONS]
258
+
259
+ Options:
260
+ -v, --version display the version and exit
261
+ -p, --path PATH local pdf filepath or directory [required]
262
+ -o, --output-dir TEXT output local directory
263
+ -m, --method [ocr|txt|auto] the method for parsing pdf.
264
+ ocr: using ocr technique to extract information from pdf,
265
+ txt: suitable for the text-based pdf only and outperform ocr,
266
+ auto: automatically choose the best method for parsing pdf
267
+ from ocr and txt.
268
+ without method specified, auto will be used by default.
269
+ --help Show this message and exit.
270
+
271
+
272
+ ## show version
273
+ magic-pdf -v
274
+
275
+ ## command line example
276
+ magic-pdf -p {some_pdf} -o {some_output_dir} -m auto
277
+ ```
278
+
279
+ `{some_pdf}` can be a single PDF file or a directory containing multiple PDFs.
280
+ The results will be saved in the `{some_output_dir}` directory. The output file list is as follows:
281
+
282
+ ```text
283
+ ├── some_pdf.md # markdown file
284
+ ├── images # directory for storing images
285
+ ├── layout.pdf # layout diagram
286
+ ├── middle.json # MinerU intermediate processing result
287
+ ├── model.json # model inference result
288
+ ├── origin.pdf # original PDF file
289
+ └── spans.pdf # smallest granularity bbox position information diagram
290
+ ```
291
+
292
+ For more information about the output files, please refer to the [Output File Description](docs/output_file_en_us.md).
293
+
294
+ ### API
295
+
296
+ Processing files from local disk
297
+ ```python
298
+ image_writer = DiskReaderWriter(local_image_dir)
299
+ image_dir = str(os.path.basename(local_image_dir))
300
+ jso_useful_key = {"_pdf_type": "", "model_list": []}
301
+ pipe = UNIPipe(pdf_bytes, jso_useful_key, image_writer)
302
+ pipe.pipe_classify()
303
+ pipe.pipe_analyze()
304
+ pipe.pipe_parse()
305
+ md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none")
306
+ ```
307
+
308
+ Processing files from object storage
309
+ ```python
310
+ s3pdf_cli = S3ReaderWriter(pdf_ak, pdf_sk, pdf_endpoint)
311
+ image_dir = "s3://img_bucket/"
312
+ s3image_cli = S3ReaderWriter(img_ak, img_sk, img_endpoint, parent_path=image_dir)
313
+ pdf_bytes = s3pdf_cli.read(s3_pdf_path, mode=s3pdf_cli.MODE_BIN)
314
+ jso_useful_key = {"_pdf_type": "", "model_list": []}
315
+ pipe = UNIPipe(pdf_bytes, jso_useful_key, s3image_cli)
316
+ pipe.pipe_classify()
317
+ pipe.pipe_analyze()
318
+ pipe.pipe_parse()
319
+ md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none")
320
+ ```
321
+
322
+ For detailed implementation, refer to:
323
+ - [demo.py Simplest Processing Method](demo/demo.py)
324
+ - [magic_pdf_parse_main.py More Detailed Processing Workflow](demo/magic_pdf_parse_main.py)
325
+
326
+
327
+ ### Development Guide
328
+
329
+ TODO
330
+
331
+ # TODO
332
+
333
+ - [ ] Semantic-based reading order
334
+ - [ ] List recognition within the text
335
+ - [ ] Code block recognition within the text
336
+ - [ ] Table of contents recognition
337
+ - [x] Table recognition
338
+ - [ ] Chemical formula recognition
339
+ - [ ] Geometric shape recognition
340
+
341
+ # Known Issues
342
+ - Reading order is segmented based on rules, which can cause disordered sequences in some cases
343
+ - Vertical text is not supported
344
+ - Lists, code blocks, and table of contents are not yet supported in the layout model
345
+ - Comic books, art books, elementary school textbooks, and exercise books are not well-parsed yet
346
+ - Enabling OCR may produce better results in PDFs with a high density of formulas
347
+ - 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.
348
+ - **Table Recognition** is currently in the testing phase; recognition speed is slow, and accuracy needs improvement. Below are some performance test results in an Ubuntu 22.04 LTS + Intel(R) Xeon(R) Platinum 8352V CPU @ 2.10GHz + NVIDIA GeForce RTX 4090 environment for reference.
349
+
350
+ | Table Size | Parsing Time |
351
+ |---------------|----------------------------|
352
+ | 6\*5 55kb | 37s |
353
+ | 16\*12 284kb | 3m18s |
354
+ | 44\*7 559kb | 4m12s |
355
+
356
+ # FAQ
357
+ [FAQ in Chinese](docs/FAQ_zh_cn.md)
358
+
359
+ [FAQ in English](docs/FAQ_en_us.md)
360
+
361
+
362
+ # All Thanks To Our Contributors
363
+
364
+ <a href="https://github.com/opendatalab/MinerU/graphs/contributors">
365
+ <img src="https://contrib.rocks/image?repo=opendatalab/MinerU" />
366
+ </a>
367
+
368
+ # License Information
369
+
370
+ [LICENSE.md](LICENSE.md)
371
+
372
+ This project currently uses PyMuPDF to achieve advanced functionality. However, since it adheres to the AGPL license, it may impose restrictions on certain usage scenarios. In future iterations, we plan to explore and replace it with a more permissive PDF processing library to enhance user-friendliness and flexibility.
373
+
374
+
375
+ # Acknowledgments
376
+ - [PDF-Extract-Kit](https://github.com/opendatalab/PDF-Extract-Kit)
377
+ - [StructEqTable](https://github.com/UniModal4Reasoning/StructEqTable-Deploy)
378
+ - [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
379
+ - [PyMuPDF](https://github.com/pymupdf/PyMuPDF)
380
+ - [fast-langdetect](https://github.com/LlmKira/fast-langdetect)
381
+ - [pdfminer.six](https://github.com/pdfminer/pdfminer.six)
382
+
383
+ # Citation
384
+
385
+ ```bibtex
386
+ @article{he2024opendatalab,
387
+ title={Opendatalab: Empowering general artificial intelligence with open datasets},
388
+ author={He, Conghui and Li, Wei and Jin, Zhenjiang and Xu, Chao and Wang, Bin and Lin, Dahua},
389
+ journal={arXiv preprint arXiv:2407.13773},
390
+ year={2024}
391
+ }
392
+
393
+ @misc{2024mineru,
394
+ title={MinerU: A One-stop, Open-source, High-quality Data Extraction Tool},
395
+ author={MinerU Contributors},
396
+ howpublished = {\url{https://github.com/opendatalab/MinerU}},
397
+ year={2024}
398
+ }
399
+ ```
400
+
401
+ # Star History
402
+
403
+ <a>
404
+ <picture>
405
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=opendatalab/MinerU&type=Date&theme=dark" />
406
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=opendatalab/MinerU&type=Date" />
407
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=opendatalab/MinerU&type=Date" />
408
+ </picture>
409
+ </a>
410
+
411
+ # Magic-doc
412
+ [Magic-Doc](https://github.com/InternLM/magic-doc) Fast speed ppt/pptx/doc/docx/pdf extraction tool
413
+
414
+ # Magic-html
415
+ [Magic-HTML](https://github.com/opendatalab/magic-html) Mixed web page extraction tool
416
+
417
+ # Links
418
+
419
+ - [LabelU (A Lightweight Multi-modal Data Annotation Tool)](https://github.com/opendatalab/labelU)
420
+ - [LabelLLM (An Open-source LLM Dialogue Annotation Platform)](https://github.com/opendatalab/LabelLLM)
421
+ - [PDF-Extract-Kit (A Comprehensive Toolkit for High-Quality PDF Content Extraction)](https://github.com/opendatalab/PDF-Extract-Kit)
@@ -1,14 +1,11 @@
1
1
  magic_pdf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  magic_pdf/pdf_parse_by_ocr.py,sha256=IWnSWt1Z-d35xRqspzdLR2iUtma_SAu4W7K4kEk8SHc,638
3
3
  magic_pdf/pdf_parse_by_txt.py,sha256=KUSH7Gh83CZmdyWw59pqDskwyJ2Kg-jU-9fnQGJQEs4,537
4
- magic_pdf/pdf_parse_for_train.py,sha256=Oby61DMjJ716Jj_ri7lwXfv2Chus0pbBR2RPXrmBW08,28661
5
4
  magic_pdf/pdf_parse_union_core.py,sha256=jNly6l9pGcCf7wr6s6PgQhITJZ1m9PaI32Q26zxFngs,10620
6
5
  magic_pdf/user_api.py,sha256=CVQH-VSiZpz0bSkyMT4czk1epZriIPSJsLsPbluPa9Q,3054
7
- magic_pdf/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- magic_pdf/cli/magicpdf.py,sha256=jzGSxLcx_tmjFiZfIKpomfU9rfvAwZDyMm4bmNGQmJw,13541
9
6
  magic_pdf/dict2md/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
7
  magic_pdf/dict2md/mkcontent.py,sha256=rWUY-2opd0jeowEUEVOV_uWcKum1Q7ng4nOoT6-ka_s,17459
11
- magic_pdf/dict2md/ocr_mkcontent.py,sha256=L5D6aLB3vSATfDmsXRI_Mnq79ijH6yPYdSxSJb5aFh8,15678
8
+ magic_pdf/dict2md/ocr_mkcontent.py,sha256=mq6tACGkL383bdUla7xOkRXRTBBydRtdbgIHwkk_daM,16169
12
9
  magic_pdf/filter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
10
  magic_pdf/filter/pdf_classify_by_type.py,sha256=spmDO-f2ihAl1d6-EP-j271Yi50oyu6mw4X2kRd_m0s,42320
14
11
  magic_pdf/filter/pdf_meta_scan.py,sha256=5R2XDiBZw0xd4ugbDxuyk6fztGlT5jFsGN85hLvo-hQ,17390
@@ -18,18 +15,18 @@ magic_pdf/layout/layout_det_utils.py,sha256=NCYBTvsrULE3Cue53aMD1MfXTmOL9Xy0nivl
18
15
  magic_pdf/layout/layout_sort.py,sha256=ovqRX1xcRA7E7s8VvsI7ZNbaNSElJe07bApCh5hxwIE,33533
19
16
  magic_pdf/layout/layout_spiler_recog.py,sha256=QjBSgB-a7J2yjUR1eaCs9ZD7URtiRnV6W934hpAeuC4,3067
20
17
  magic_pdf/layout/mcol_sort.py,sha256=ADnLisBJBHXDKYChcf2lzTb_TC_vZ4q89_CSN8mwEJc,11331
21
- magic_pdf/libs/Constants.py,sha256=AwQw5aK7JkWjerEyq5vxxMTHH1Gvku8K9NS8xjHKimI,189
18
+ magic_pdf/libs/Constants.py,sha256=aKdTHeK75qkVvxvE_2EA5LYis6Z6HLmiuk9o8ESOnNg,260
22
19
  magic_pdf/libs/MakeContentConfig.py,sha256=UDZPpsv8q4DqTy8h0vRtrT2kHqWiVI205VnVhlUEQc0,206
23
20
  magic_pdf/libs/ModelBlockTypeEnum.py,sha256=kalXPbo5ya6hKhhBHPGlHl1yjWOURoXZWQM3rVUyPsY,164
24
21
  magic_pdf/libs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
22
  magic_pdf/libs/boxbase.py,sha256=MvD0DypR4sTEF3T2RrI_yJ8mPDUBYHAqAaau2mnBSxY,15343
26
23
  magic_pdf/libs/calc_span_stats.py,sha256=5vnU27DcbkFDRSAoLqAmX0KQ3I9ehWkEgh_t9hxg_zI,10147
27
24
  magic_pdf/libs/commons.py,sha256=6Zu9-OyamyCNDY7qj0SxR-rux-ggj9im3CVPtC4ubB8,7108
28
- magic_pdf/libs/config_reader.py,sha256=Wlig8KRhKpz8fVNc7dlspxoccX5SnyT7FmwKj9i-gWE,2435
25
+ magic_pdf/libs/config_reader.py,sha256=dPx6JJJuCw9AzNgKtrTG1elmfdeN6gDhgFK9r15-NsE,2505
29
26
  magic_pdf/libs/convert_utils.py,sha256=Ov-lsfCLBPz_15iSJXIslBNmrSf_E_1g_XDWJy8NgO8,143
30
27
  magic_pdf/libs/coordinate_transform.py,sha256=Bbop2cP2uz2ZG0U0gwd7J6EKkgABq5Rv03qf2LMPw80,429
31
28
  magic_pdf/libs/detect_language_from_model.py,sha256=Uln8F9qs8EJOw4EgI7KRlaU3lD_mK8KMTlADLFtz8fk,816
32
- magic_pdf/libs/draw_bbox.py,sha256=90FDAYN3dxgN07_xRzdUgnDAyEswpl9VCXaDo_SMZkA,9449
29
+ magic_pdf/libs/draw_bbox.py,sha256=wPoaxXteZDCL20pjVEQ4kcu0u6Ea-9balUaxrkMsYks,12531
33
30
  magic_pdf/libs/drop_reason.py,sha256=IfjPSrPLMmVziqjOXPep7r_ioQKFRahDgbOW1SD-Tuw,2148
34
31
  magic_pdf/libs/drop_tag.py,sha256=bZDg3bIVWvBT1Ec1icwj5WLOkt5-hI6eRYZ2tX9_a74,673
35
32
  magic_pdf/libs/hash_utils.py,sha256=VEKK9WfFoZgrPfi8kfITjLpr8Ahufs8tXh9R1Y5lAL8,404
@@ -38,19 +35,19 @@ magic_pdf/libs/language.py,sha256=Hj5-lrGoNExxdHLbkcNG-c27U4AjJ9AZPdZblaNSehU,10
38
35
  magic_pdf/libs/local_math.py,sha256=tqljQOgqh3fZc146HYhO88JXJaiXMVwArBkk_CSGICc,177
39
36
  magic_pdf/libs/markdown_utils.py,sha256=cLxLXjRhrNp_wCHvtglrGA_FVdrvfd1KULeTtj1p18w,944
40
37
  magic_pdf/libs/nlp_utils.py,sha256=-X9W3-Ns5ZdDYFvyyEq6i6P2b5hCATaFEZeOjwNOH9M,6901
41
- magic_pdf/libs/ocr_content_type.py,sha256=DiGTYppd6WlibwCAeVpIy3NHCQkglfIAQsJ_ffu5BPw,526
38
+ magic_pdf/libs/ocr_content_type.py,sha256=9c12CoJ8xvdFa4Rk81J_S238yuQl0bDQeapvqb-JkEk,794
42
39
  magic_pdf/libs/path_utils.py,sha256=Hykw_l5CU736b2egHV9P7B-qh3QNKO4nZSGCbsi0Z8E,1043
43
40
  magic_pdf/libs/pdf_check.py,sha256=MAe8wzwT0qvPf_I72wEZG7k1g4haNHS7oUtLqkB5rlE,2145
44
41
  magic_pdf/libs/pdf_image_tools.py,sha256=CAd01giTKr_UJz1_QtDOARG9G9z69GFpzRZwcWSfLtE,1282
45
42
  magic_pdf/libs/safe_filename.py,sha256=ckwcM_eqoysTb5id8czp-tXq2G9da0-l3pshZDCHQtE,236
46
43
  magic_pdf/libs/textbase.py,sha256=SC1Frhz3Fb7V7n2SFRBsl7Bmg0JZdlvZskq0lfW1vIk,732
47
- magic_pdf/libs/version.py,sha256=ZMr9EH74nzdVNg9PXVs5XLZcabTX-_J2XZD1VgXHRBE,24
44
+ magic_pdf/libs/version.py,sha256=95eHzU5LYX2l3ASu7OvUb95xo-2kfuwh1uUYnY54K90,24
48
45
  magic_pdf/libs/vis_utils.py,sha256=hTOTEakKV0pGMbk0tbRkVI_tku7A3dGc96ynObZ4kwI,10207
49
46
  magic_pdf/model/__init__.py,sha256=1QcfMKET0xQhSaZMjNQHi_TjzSSDR6PI5mjkmaXHPe8,52
50
- magic_pdf/model/doc_analyze_by_custom_model.py,sha256=0YyZoDUQBFQIDiHDK59JEql9FKSkZMr8aGN0Tw1eL8k,4064
51
- magic_pdf/model/magic_model.py,sha256=tIGi-vtn6OUDqs3mtW2YLzoFvSPu4kkBiHJUv6o0Kic,25233
47
+ magic_pdf/model/doc_analyze_by_custom_model.py,sha256=SoT21VHy6ICXoRfC9V3XS6BMiX8EZI6zaqSNgoE17oo,4347
48
+ magic_pdf/model/magic_model.py,sha256=xwKV9BrdjOJecJSzbErT54N6qeJu0tvFuJg2S1z_2kU,25413
52
49
  magic_pdf/model/model_list.py,sha256=AqxAtKGLDn7VVXWYwk0l9LnACxDLyU2jwOJ7vjPZj04,72
53
- magic_pdf/model/pdf_extract_kit.py,sha256=ecoTBn7ROmfU1KxFpFzu7yXw7aezmPV6xOht7PRmPHA,10692
50
+ magic_pdf/model/pdf_extract_kit.py,sha256=21vBy8p6pI5a0b6V45ul52yE8zD1R0xrjv4Tx8r9gaw,13620
54
51
  magic_pdf/model/pp_structure_v2.py,sha256=1sn8IJK0d5ZmqJ2XFt9FdaSdI0RQf-iwNAWBrVrIeuc,2872
55
52
  magic_pdf/model/pek_sub_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
53
  magic_pdf/model/pek_sub_modules/post_process.py,sha256=HzRxV2sVR3Qo8XKYEHhT6tae-bYTb6dnAfGP6gfVNaM,1135
@@ -75,6 +72,8 @@ magic_pdf/model/pek_sub_modules/layoutlmv3/layoutlmft/models/layoutlmv3/configur
75
72
  magic_pdf/model/pek_sub_modules/layoutlmv3/layoutlmft/models/layoutlmv3/modeling_layoutlmv3.py,sha256=mdo8tO-DrJcv0Lbk9Pp98n3NQXYOnFFyXQWjU7t35kA,54633
76
73
  magic_pdf/model/pek_sub_modules/layoutlmv3/layoutlmft/models/layoutlmv3/tokenization_layoutlmv3.py,sha256=diKlrfxYjKAmYrUgjYdx-FXLh-swShC3tl-EBX1b3oI,1197
77
74
  magic_pdf/model/pek_sub_modules/layoutlmv3/layoutlmft/models/layoutlmv3/tokenization_layoutlmv3_fast.py,sha256=0lxiG69_fGpSSBYA9CBLnDa_qqa1rInZ0pJpqBwZ0Yw,1372
75
+ magic_pdf/model/pek_sub_modules/structeqtable/StructTableModel.py,sha256=BdrBZ_2B2jgF0vzn_ted8bE9Te-DC1Ea2UijqULNKjg,928
76
+ magic_pdf/model/pek_sub_modules/structeqtable/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
77
  magic_pdf/para/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
79
78
  magic_pdf/para/block_continuation_processor.py,sha256=IkReB5hirjm0OAirNzQQpnWe2f2bdP3Hug3Ef8qTRDA,22749
80
79
  magic_pdf/para/block_termination_processor.py,sha256=YU3ZYqJy9e3OQmOuQYZrR6AUpmAlQ0mhj0PgZZPZ_fM,17957
@@ -128,23 +127,22 @@ magic_pdf/pre_proc/resolve_bbox_conflict.py,sha256=bJiegofPUeDyi--oZjfipQ5Q5RLm6
128
127
  magic_pdf/pre_proc/solve_line_alien.py,sha256=aNoQptPcC38Sm1I2ABhgw8jeH_5kjsRHx3VYlFFtm1g,853
129
128
  magic_pdf/pre_proc/statistics.py,sha256=_9jGlXq0iXd03UMxB92ZqCiu7cjNkG5vHvFlTF_9ytA,220
130
129
  magic_pdf/resources/fasttext-langdetect/lid.176.ftz,sha256=jzRyz-hzintgmejpmcPL-uDc0VaWqsfXc4qAOdtgPoM,938013
131
- magic_pdf/resources/model_config/model_configs.yaml,sha256=C_9UfFMlHOX-iSgcwCHjyHKazKKuwpy1RcGHeTQD1kY,139
130
+ magic_pdf/resources/model_config/model_configs.yaml,sha256=2MxCOJ5yNUupQqvrAvEuJKlygjxxV_o1qE64K_4NWKA,235
132
131
  magic_pdf/resources/model_config/UniMERNet/demo.yaml,sha256=al9_--m3n2j9zEn9OjlmmpfQbqVBAYFakXc_hY4vDXo,807
133
132
  magic_pdf/resources/model_config/layoutlmv3/layoutlmv3_base_inference.yaml,sha256=9aNAEYgpHTAWpcUrDvuPG2y4V-Qw8QdcJefi96y8yDU,6109
134
- magic_pdf/rw/AbsReaderWriter.py,sha256=1Hd6Xo2g12CaRAo5Sze-R_GSQA6GQ0rQwSmgQvw4V_c,1297
135
- magic_pdf/rw/DiskReaderWriter.py,sha256=0tt8lbRyqrOfFgGlhjt24YMdj2xN7QUIVysfhFIxPgo,2113
136
- magic_pdf/rw/S3ReaderWriter.py,sha256=O7Quf3CUqXBjMz4sIE7kNVI3TIQROeg5PuXneAacieY,4474
133
+ magic_pdf/rw/AbsReaderWriter.py,sha256=2H5SDJfAAOX9kPfel06a8VRCHxD1Y8aPbWEkQDdn9JM,452
134
+ magic_pdf/rw/DiskReaderWriter.py,sha256=7ZAekH8V6xlBo_1WeSZ6sNwAj2WGPtjNl50zq1CoMDY,2614
135
+ magic_pdf/rw/S3ReaderWriter.py,sha256=_DmL45Ubio-_VsKD84KrqOQ-VNDUTzcXSrXfNMb5vww,5310
137
136
  magic_pdf/rw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
138
137
  magic_pdf/spark/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
139
138
  magic_pdf/spark/spark_api.py,sha256=eSLXTjMYW5Ya41VMIApRVfji1ZxEZXdH9ZdsL6fy5Kw,1131
140
- magic_pdf/train_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
141
- magic_pdf/train_utils/convert_to_train_format.py,sha256=ifo2FAoBMa_etCvz0O4v03xO6mHV8IPXYxHH7-OcHfk,2443
142
- magic_pdf/train_utils/extract_caption.py,sha256=gommEqIEWLplSDEJWD7_66daqlOBsWhpRBW1DHpkny4,1825
143
- magic_pdf/train_utils/remove_footer_header.py,sha256=pyeNNdJ-th3wl5Xwb10ZLYNaFN4-6BmahoMFE8VTNNs,5978
144
- magic_pdf/train_utils/vis_utils.py,sha256=MV9N9cT3ifJ35u7LFKGF9I_bOIQrtU1zcsxu2hj3aqM,10111
145
- magic_pdf-0.6.2b1.dist-info/LICENSE.md,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
146
- magic_pdf-0.6.2b1.dist-info/METADATA,sha256=DVFHn5RBQilga9OZp87sGf4e4wAE-XT8QpB6KSVUgoo,11541
147
- magic_pdf-0.6.2b1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
148
- magic_pdf-0.6.2b1.dist-info/entry_points.txt,sha256=NbSkSmE08UuTwdoJD8Uofq8iyufySA4x7jmIIk4YCzI,57
149
- magic_pdf-0.6.2b1.dist-info/top_level.txt,sha256=J9I0AzmHWGkp9c6DL8Oe4mEx3yYphLzkRn4H25Lg1rE,10
150
- magic_pdf-0.6.2b1.dist-info/RECORD,,
139
+ magic_pdf/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
140
+ magic_pdf/tools/cli.py,sha256=aVmurGAEyWT-MOv0MOaCRrfef1-jkRTpeVVWUsEVyeY,2157
141
+ magic_pdf/tools/cli_dev.py,sha256=w-J4OixDzHjknnUuRW44PXsUlUqyiD4nPbBSSk9WkXM,4160
142
+ magic_pdf/tools/common.py,sha256=XoSs19DD-4ubbjrDFQer83T9O6O_MmgEO61NbjlP_2M,3939
143
+ magic_pdf-0.7.0b1.dist-info/LICENSE.md,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
144
+ magic_pdf-0.7.0b1.dist-info/METADATA,sha256=47QGAd2iGc0i1osA_jbBS1QT_Jrfmofoyetsrh9KRy8,18571
145
+ magic_pdf-0.7.0b1.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
146
+ magic_pdf-0.7.0b1.dist-info/entry_points.txt,sha256=wXwYke3j8fqDQTocUspL-CqDUEv3Tfcwp09fM8dZAhA,98
147
+ magic_pdf-0.7.0b1.dist-info/top_level.txt,sha256=J9I0AzmHWGkp9c6DL8Oe4mEx3yYphLzkRn4H25Lg1rE,10
148
+ magic_pdf-0.7.0b1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: bdist_wheel (0.44.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ magic-pdf = magic_pdf.tools.cli:cli
3
+ magic-pdf-dev = magic_pdf.tools.cli_dev:cli