Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解析pdf中的html链接,会出现多余空格 #757

Closed
xiaotaozi121096 opened this issue Oct 18, 2024 · 14 comments
Closed

解析pdf中的html链接,会出现多余空格 #757

xiaotaozi121096 opened this issue Oct 18, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@xiaotaozi121096
Copy link

Description of the bug | 错误描述

解析pdf中的html链接,会出现多余空格
2
123

How to reproduce the bug | 如何复现

正常运行提取pdf,但不使用公式识别,只用layoutlmv3和paddleocr

Operating system | 操作系统

Linux

Python version | Python 版本

3.10

Software version | 软件版本 (magic-pdf --version)

0.8.x

Device mode | 设备模式

cuda

@xiaotaozi121096 xiaotaozi121096 added the bug Something isn't working label Oct 18, 2024
@myhloli
Copy link
Collaborator

myhloli commented Oct 18, 2024

请把pdf文件上传一下

@xiaotaozi121096
Copy link
Author

从spans文件中看,划分是正确的,但是md文件就会出现多余的空格
DCU镜像使用手册-v1.8.0_origin_origin.md
DCU镜像使用手册-v1.8.0_origin_origin.pdf
DCU镜像使用手册-v1.8.0_origin_origin_spans.pdf
image
image
这是我的magic_pdf版本
image

@myhloli
Copy link
Collaborator

myhloli commented Oct 18, 2024

之前的ocr框选范围太贴字边了,可能会有些ocr出错的情况
最近修复了这个问题,可以在huggingface或modelscope的在线demo上验证
image

另外建议使用auto模式,这篇文档用auto模式可以正常提取文本信息且准确率较高,只有在auto模式不理想的情况下才使用ocr模式。

@myhloli myhloli closed this as completed Oct 18, 2024
@xiaotaozi121096
Copy link
Author

是我需要下载最新版本的magic-pdf就能解决吗?我默认使用的就是auto,只是在pipe/UNiPipe中,选择了PIP_ocr,而不是PIP_txt

@myhloli
Copy link
Collaborator

myhloli commented Oct 18, 2024

新版本没有release,仅在dev分支进行测试。因为涉及到一些模型的更新,目前不能直接更新,请等待后续新版本发布。
如果有测试的需求,可以在在线demo上进行测试。

@xiaotaozi121096
Copy link
Author

image
我当前用的版本,layout.pdf,也是像你一样的输出,但是md就会出现空格,想知道你用的是什么版本,我去测试下,在魔搭上测试,确实没有空格

@myhloli
Copy link
Collaborator

myhloli commented Oct 18, 2024

我使用的是dev分支的版本

@xiaotaozi121096
Copy link
Author

这个版本是只更新了代码,扩大了框选范围,还是也更新了模型?是替换了模型吗?

@myhloli
Copy link
Collaborator

myhloli commented Oct 18, 2024

模型有更新,解析处理的逻辑也有更新,这个版本的变动是比较大的

@xiaotaozi121096
Copy link
Author

好嘞,期待新版本了

@xiaotaozi121096
Copy link
Author

我用了dev版本,结果还是会出现空格,估计是没换模型的原因吧,我模型还是用之前的

@myhloli
Copy link
Collaborator

myhloli commented Oct 18, 2024

我用了dev版本,结果还是会出现空格,估计是没换模型的原因吧,我模型还是用之前的

空格和模型无关,dev不能直接升级,估计你这个是没安装成功

@xiaotaozi121096
Copy link
Author

选择dev分支,然后下载的
image

@xiaotaozi121096
Copy link
Author

我用了dev版本,结果还是会出现空格,估计是没换模型的原因吧,我模型还是用之前的

空格和模型无关,dev不能直接升级,估计你这个是没安装成功

嗯嗯,是我的问题,安装了dev的包,但是magic-pdf还是用之前下载的,卸载magic-pdf后,pip install -e . 就使用dev的版本了,报错模型不对,我安装模型试试,抱歉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants