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
0508df99
Unverified
Commit
0508df99
authored
Jul 04, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Jul 04, 2025
Browse files
Update mineru/utils/span_block_fix.py
Co-authored-by:
Copilot
<
175728472+Copilot@users.noreply.github.com
>
parent
18691cfd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
mineru/utils/span_block_fix.py
mineru/utils/span_block_fix.py
+2
-1
No files found.
mineru/utils/span_block_fix.py
View file @
0508df99
...
@@ -73,9 +73,10 @@ def fix_text_block(block):
...
@@ -73,9 +73,10 @@ def fix_text_block(block):
span
[
'type'
]
=
ContentType
.
INLINE_EQUATION
span
[
'type'
]
=
ContentType
.
INLINE_EQUATION
# 假设block中的span超过80%的数量高度是宽度的两倍以上,则认为是纵向文本块
# 假设block中的span超过80%的数量高度是宽度的两倍以上,则认为是纵向文本块
VERTICAL_TEXT_RATIO_THRESHOLD
=
2
# Threshold for determining vertical text blocks
vertical_span_count
=
sum
(
vertical_span_count
=
sum
(
1
for
span
in
block
[
'spans'
]
1
for
span
in
block
[
'spans'
]
if
(
span
[
'bbox'
][
3
]
-
span
[
'bbox'
][
1
])
/
(
span
[
'bbox'
][
2
]
-
span
[
'bbox'
][
0
])
>
2
if
(
span
[
'bbox'
][
3
]
-
span
[
'bbox'
][
1
])
/
(
span
[
'bbox'
][
2
]
-
span
[
'bbox'
][
0
])
>
VERTICAL_TEXT_RATIO_THRESHOLD
)
)
total_span_count
=
len
(
block
[
'spans'
])
total_span_count
=
len
(
block
[
'spans'
])
if
total_span_count
==
0
:
if
total_span_count
==
0
:
...
...
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