Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pdf-miner
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qin Kaijie
pdf-miner
Commits
61572264
Unverified
Commit
61572264
authored
Apr 22, 2024
by
myhloli
Committed by
GitHub
Apr 22, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39 from myhloli/master
增加一个block嵌套问题的todo
parents
f5268688
3d60c2e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
magic_model.py
magic_pdf/model/magic_model.py
+1
-1
pdf_parse_by_ocr_v2.py
magic_pdf/pdf_parse_by_ocr_v2.py
+4
-0
No files found.
magic_pdf/model/magic_model.py
View file @
61572264
...
...
@@ -385,7 +385,7 @@ class MagicModel:
allow_category_id_list
=
[
3
,
5
,
13
,
14
,
15
]
"""当成span拼接的"""
# 3: 'image', # 图片
#
4
: 'table', # 表格
#
5
: 'table', # 表格
# 13: 'inline_equation', # 行内公式
# 14: 'interline_equation', # 行间公式
# 15: 'text', # ocr识别文本
...
...
magic_pdf/pdf_parse_by_ocr_v2.py
View file @
61572264
...
...
@@ -70,6 +70,10 @@ def parse_pdf_by_ocr(pdf_bytes,
'''根据layout顺序,对当前页面所有需要留下的block进行排序'''
sorted_blocks
=
sort_blocks_by_layout
(
all_bboxes
,
layout_bboxes
)
'''block嵌套问题解决'''
#@todo 1. text block大框套小框,删除小框 2. 图片或文本框与舍弃框重叠,优先信任舍弃框 3. 文本框与标题框重叠,优先信任文本框
'''获取所有需要拼接的span资源'''
spans
=
magic_model
.
get_all_spans
(
page_id
)
'''删除重叠spans中较小的那些'''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment