Commit a53cb30f authored by myhloli's avatar myhloli

Merge remote-tracking branch 'origin/master'

parents 3ef4d054 8d88330d
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<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> <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>
<!-- language --> <!-- language -->
[English](README.md) | [简体中文](README_zh-CN.md) | [日本語](README_ja-JP.md) [English](README.md) | [简体中文](README_zh-CN.md)
<!-- hot link --> <!-- hot link -->
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
# 更新记录 # 更新记录
- 2024/07/08 首次开源 - 2024/08/01 0.6.2b1发布,优化了依赖冲突问题和安装文档
- 2024/07/05 首次开源
<!-- TABLE OF CONTENT --> <!-- TABLE OF CONTENT -->
...@@ -82,6 +83,7 @@ ...@@ -82,6 +83,7 @@
## 项目简介 ## 项目简介
MinerU是一款将PDF转化为机器可读格式的工具(如markdown、json),可以很方便地抽取为任意格式。 MinerU是一款将PDF转化为机器可读格式的工具(如markdown、json),可以很方便地抽取为任意格式。
MinerU诞生于[书生-浦语](https://github.com/InternLM/InternLM)的预训练过程中,我们将会集中精力解决科技文献中的符号转化问题,希望在大模型时代为科技发展做出贡献。 MinerU诞生于[书生-浦语](https://github.com/InternLM/InternLM)的预训练过程中,我们将会集中精力解决科技文献中的符号转化问题,希望在大模型时代为科技发展做出贡献。
相比国内外知名商用产品MinerU还很年轻,如果遇到问题或者结果不及预期请到issue提交问题,同时附上相关PDF。
https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
...@@ -305,6 +307,7 @@ TODO ...@@ -305,6 +307,7 @@ TODO
- 列表、代码块、目录在layout模型里还没有支持 - 列表、代码块、目录在layout模型里还没有支持
- 漫画书、艺术图册、小学教材、习题尚不能很好解析 - 漫画书、艺术图册、小学教材、习题尚不能很好解析
- 在一些公式密集的PDF上强制启用OCR效果会更好 - 在一些公式密集的PDF上强制启用OCR效果会更好
- 如果您要处理包含大量公式的pdf,强烈建议开启OCR功能。使用pymuPDF提取文字的时候会出现文本行互相重叠的情况导致公式插入位置不准确。
好消息是,这些我们正在努力实现! 好消息是,这些我们正在努力实现!
...@@ -327,7 +330,7 @@ The project currently leverages PyMuPDF to deliver advanced functionalities; how ...@@ -327,7 +330,7 @@ The project currently leverages PyMuPDF to deliver advanced functionalities; how
# Acknowledgments # Acknowledgments
- [StructEqTable](https://github.com/UniModal4Reasoning/StructEqTable-Deploy) 🔥🔥🔥 - [StructEqTable](https://github.com/UniModal4Reasoning/StructEqTable-Deploy)
- [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) - [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
- [PyMuPDF](https://github.com/pymupdf/PyMuPDF) - [PyMuPDF](https://github.com/pymupdf/PyMuPDF)
- [fast-langdetect](https://github.com/LlmKira/fast-langdetect) - [fast-langdetect](https://github.com/LlmKira/fast-langdetect)
......
...@@ -2,38 +2,35 @@ ...@@ -2,38 +2,35 @@
模型文件可以从Hugging Face 或 Model Scope 下载,由于网络原因,国内用户访问HF 可能会失败,请使用 ModelScope。 模型文件可以从Hugging Face 或 Model Scope 下载,由于网络原因,国内用户访问HF 可能会失败,请使用 ModelScope。
[Hugging Face](#从-Hugging-Face-下载模型) [Hugging Face](#从-Hugging-Face-下载模型)
[ModelScope](#从-ModelScope-下载模型) [ModelScope](#从-ModelScope-下载模型)
## 从 Hugging Face 下载模型 ## 方法一:从 Hugging Face 下载模型
### 1.安装 Git LFS
开始之前,请确保您的系统上已安装 Git 大文件存储 (Git LFS)。使用以下命令进行安装
```bash
git lfs install
```
### 2.从 Hugging Face 下载模型 使用Git LFS 从Hugging Face下载模型文件
请使用以下命令从 Hugging Face 下载 PDF-Extract-Kit 模型:
```bash ```bash
git lfs clone https://huggingface.co/wanderkid/PDF-Extract-Kit git lfs install # 安装 Git 大文件存储插件 (Git LFS)
git lfs clone https://huggingface.co/wanderkid/PDF-Extract-Kit # 从 Hugging Face 下载 PDF-Extract-Kit 模型
``` ```
确保在克隆过程中启用了 Git LFS,以便正确下载所有大文件。
## 方法二:从 ModelScope 下载模型
ModelScope 支持SDK或模型下载,任选一个即可。
## 从 ModelScope 下载模型 [Git lsf下载](#git下载)
ModelScope 支持SDK或模型下载
[SDK下载](#sdk下载) [SDK下载](#sdk下载)
[Git下载](#git下载) ### 1)利用Git lsf下载
```bash
git lfs install
git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git
```
### SDK下载 ### 2)利用SDK下载
```bash ```bash
# 首先安装modelscope # 首先安装modelscope
...@@ -46,35 +43,18 @@ from modelscope import snapshot_download ...@@ -46,35 +43,18 @@ from modelscope import snapshot_download
model_dir = snapshot_download('wanderkid/PDF-Extract-Kit') model_dir = snapshot_download('wanderkid/PDF-Extract-Kit')
``` ```
### Git下载
也可以使用git clone从 ModelScope 下载模型:
#### 1.安装 Git LFS
开始之前,请确保您的系统上已安装 Git 大文件存储 (Git LFS)。使用以下命令进行安装
```bash
git lfs install
```
#### 2.然后通过git lfs下载模型
```bash
git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git
```
## 额外步骤 ## 额外步骤
### 1.检查模型目录是否下载完整 ### 1.检查模型目录是否下载完整
模型文件夹的结构如下,包含了不同组件的配置文件和权重文件: 模型文件夹的结构如下,包含了不同组件的配置文件和权重文件:
``` ```
./ ./
├── Layout ├── Layout # 布局检测模型
│ ├── config.json │ ├── config.json
│ └── model_final.pth │ └── model_final.pth
├── MFD ├── MFD # 公式检测
│ └── weights.pt │ └── weights.pt
├── MFR ├── MFR # 公式识别模型
│ └── UniMERNet │ └── UniMERNet
│ ├── config.json │ ├── config.json
│ ├── preprocessor_config.json │ ├── preprocessor_config.json
...@@ -82,7 +62,7 @@ git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git ...@@ -82,7 +62,7 @@ git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git
│ ├── README.md │ ├── README.md
│ ├── tokenizer_config.json │ ├── tokenizer_config.json
│ └── tokenizer.json │ └── tokenizer.json
│── TabRec │── TabRec # 表格识别模型
│ └─StructEqTable │ └─StructEqTable
│ ├── config.json │ ├── config.json
│ ├── generation_config.json │ ├── generation_config.json
...@@ -100,3 +80,4 @@ git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git ...@@ -100,3 +80,4 @@ git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git
### 3.移动模型到固态硬盘 ### 3.移动模型到固态硬盘
将 'models' 目录移动到具有较大磁盘空间的目录中,最好是在固态硬盘(SSD)上。 将 'models' 目录移动到具有较大磁盘空间的目录中,最好是在固态硬盘(SSD)上。
此外在 `~/magic-pdf.json`里修改模型的目录指向最终的模型存放位置,否则会报模型无法加载的错误。
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment