Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
1b8ea610
Commit
1b8ea610
authored
Apr 16, 2024
by
kernel.h@qq.com
Browse files
update
parent
0a3afbf0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
magic_pdf/model/magic_model.py
magic_pdf/model/magic_model.py
+1
-1
magic_pdf/para/para_split.py
magic_pdf/para/para_split.py
+4
-2
No files found.
magic_pdf/model/magic_model.py
View file @
1b8ea610
...
...
@@ -32,7 +32,7 @@ class MagicModel():
def
get_equations
(
self
,
page_no
:
int
)
->
list
:
# 有坐标,也有字
return
inline_equations
,
interline_equations
# @凯文
def
get_discarded
(
self
,
page_no
:
int
)
->
list
:
# 自研模型,只有坐标
def
get_discarded
(
self
,
page_no
:
int
)
->
list
:
# 自研模型,只有坐标
pass
# @凯文
def
get_text_blocks
(
self
,
page_no
:
int
)
->
list
:
# 自研模型搞的,只有坐标,没有字
...
...
magic_pdf/para/para_split.py
View file @
1b8ea610
...
...
@@ -299,9 +299,9 @@ def __split_para_in_layoutbox(lines_group, new_layout_bbox, lang="en", char_avg_
layout_list_info
[
0
]
=
True
if
end
==
total_lines
-
1
:
layout_list_info
[
1
]
=
True
else
:
else
:
# 是普通文本
for
i
,
line
in
enumerate
(
lines
[
start
:
end
+
1
]):
# 如果i有下一行,那么就要根据下一行位置综合判断是否要分段。如果i之后没有行,那么只需要判断
一下行
结尾特征。
# 如果i有下一行,那么就要根据下一行位置综合判断是否要分段。如果i之后没有行,那么只需要判断
i行自己的
结尾特征。
cur_line_type
=
line
[
'spans'
][
-
1
][
'type'
]
next_line
=
lines
[
i
+
1
]
if
i
<
total_lines
-
1
else
None
...
...
@@ -341,6 +341,8 @@ def __connect_list_inter_layout(layout_paras, new_layout_bbox, layout_list_info,
"""
if
len
(
layout_paras
)
==
0
or
len
(
layout_list_info
)
==
0
:
# 0的时候最后的return 会出错
return
layout_paras
,
[
False
,
False
]
if
page_num
==
343
:
pass
for
i
in
range
(
1
,
len
(
layout_paras
)):
pre_layout_list_info
=
layout_list_info
[
i
-
1
]
...
...
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