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
bf7d2c4f
Unverified
Commit
bf7d2c4f
authored
Nov 19, 2024
by
Xiaomeng Zhao
Committed by
GitHub
Nov 19, 2024
Browse files
Merge pull request #1018 from myhloli/dev
refactor(para): adjust right margin threshold based on block width
parents
98638bb6
69805f4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
magic_pdf/para/para_split_v3.py
magic_pdf/para/para_split_v3.py
+6
-2
No files found.
magic_pdf/para/para_split_v3.py
View file @
bf7d2c4f
...
@@ -121,8 +121,12 @@ def __is_list_or_index_block(block):
...
@@ -121,8 +121,12 @@ def __is_list_or_index_block(block):
right_close_num
+=
1
right_close_num
+=
1
else
:
else
:
# 右侧不顶格情况下是否有一段距离,拍脑袋用0.3block宽度做阈值
# 右侧不顶格情况下是否有一段距离,拍脑袋用0.3block宽度做阈值
# 0.26
# block宽的阈值可以小些,block窄的阈值要大
closed_area
=
0.35
*
block_weight
if
block_weight_radio
>=
0.5
:
closed_area
=
0.26
*
block_weight
else
:
closed_area
=
0.36
*
block_weight
if
block
[
'bbox_fs'
][
2
]
-
line
[
'bbox'
][
2
]
>
closed_area
:
if
block
[
'bbox_fs'
][
2
]
-
line
[
'bbox'
][
2
]
>
closed_area
:
right_not_close_num
+=
1
right_not_close_num
+=
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