https://github.com/opendatalab/MinerU.git
|
|
há 1 ano atrás | |
|---|---|---|
| .github | há 1 ano atrás | |
| assets | há 1 ano atrás | |
| demo | há 1 ano atrás | |
| docs | há 1 ano atrás | |
| magic_pdf | há 1 ano atrás | |
| others | há 1 ano atrás | |
| tests | há 1 ano atrás | |
| tools | há 1 ano atrás | |
| .gitignore | há 1 ano atrás | |
| LICENSE.md | há 1 ano atrás | |
| README.md | há 1 ano atrás | |
| README_zh-CN.md | há 1 ano atrás | |
| magic-pdf.template.json | há 1 ano atrás | |
| requirements-qa.txt | há 1 ano atrás | |
| requirements.txt | há 1 ano atrás | |
| setup.py | há 1 ano atrás | |
| update_version.py | há 1 ano atrás |
MinerU is a one-stop, open-source, high-quality data extraction tool, includes the following primary features:
Magic-PDF is a tool designed to convert PDF documents into Markdown format, capable of processing files stored locally or on object storage supporting S3 protocol.
Key features include:
https://github.com/opendatalab/MinerU/assets/11393164/618937cb-dc6a-4646-b433-e3131a5f4070
pip install magic-pdf
cp magic-pdf.template.json ~/magic-pdf.json
magic-pdf pdf-command --pdf "pdf_path" --model "model_json_path"
After the program has finished, you can find the generated markdown files under the directory "/tmp/magic-pdf".
magic-pdf --help
image_writer = DiskReaderWriter(local_image_dir)
image_dir = str(os.path.basename(local_image_dir))
jso_useful_key = {"_pdf_type": "", "model_list": model_json}
pipe = UNIPipe(pdf_bytes, jso_useful_key, image_writer)
pipe.pipe_classify()
pipe.pipe_parse()
md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none")
s3pdf_cli = S3ReaderWriter(pdf_ak, pdf_sk, pdf_endpoint)
image_dir = "s3://img_bucket/"
s3image_cli = S3ReaderWriter(img_ak, img_sk, img_endpoint, parent_path=image_dir)
pdf_bytes = s3pdf_cli.read(s3_pdf_path, mode=s3pdf_cli.MODE_BIN)
jso_useful_key = {"_pdf_type": "", "model_list": model_json}
pipe = UNIPipe(pdf_bytes, jso_useful_key, s3image_cli)
pipe.pipe_classify()
pipe.pipe_parse()
md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none")
Demo can be referred to demo.py
Magic-Doc is a tool designed to convert web pages or multi-format e-books into markdown format.
Key Features Include:
Web Page Extraction
E-Book Document Extraction
Language Type Identification
https://github.com/opendatalab/MinerU/assets/11393164/a5a650e9-f4c0-463e-acc3-960967f1a1ca
https://github.com/opendatalab/MinerU/assets/11393164/0f4a6fe9-6cca-4113-9fdc-a537749d764d
https://github.com/opendatalab/MinerU/assets/11393164/20438a02-ce6c-4af8-9dde-d722a4e825b2
The project currently leverages PyMuPDF to deliver advanced functionalities; however, its adherence to the AGPL license may impose limitations on certain use cases. In upcoming iterations, we intend to explore and transition to a more permissively licensed PDF processing library to enhance user-friendliness and flexibility.
@misc{2024mineru,
title={MinerU: A One-stop, Open-source, High-quality Data Extraction Tool},
author={MinerU Contributors},
howpublished = {\url{https://github.com/opendatalab/MinerU}},
year={2024}
}