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
496045f3
Commit
496045f3
authored
May 31, 2024
by
赵小蒙
Browse files
update annotation
parent
75478eda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
magic_pdf/user_api.py
magic_pdf/user_api.py
+1
-1
No files found.
magic_pdf/user_api.py
View file @
496045f3
...
@@ -106,7 +106,7 @@ def parse_union_pdf(pdf_bytes: bytes, pdf_models: list, imageWriter: AbsReaderWr
...
@@ -106,7 +106,7 @@ def parse_union_pdf(pdf_bytes: bytes, pdf_models: list, imageWriter: AbsReaderWr
# not_common_character_rate = calculate_not_common_character_rate(text_all)
# not_common_character_rate = calculate_not_common_character_rate(text_all)
not_printable_rate
=
calculate_not_printable_rate
(
text_all
)
not_printable_rate
=
calculate_not_printable_rate
(
text_all
)
# 测试乱码pdf,not_common_character_rate > 0.9, not_printable_rate > 0.1
# 测试乱码pdf,not_common_character_rate > 0.9
5
, not_printable_rate > 0.1
5
# not_common_character_rate对小语种可能会有误伤,not_printable_rate对小语种较为友好
# not_common_character_rate对小语种可能会有误伤,not_printable_rate对小语种较为友好
if
pdf_info_dict
is
None
or
pdf_info_dict
.
get
(
"_need_drop"
,
False
)
or
not_printable_rate
>
0.1
:
if
pdf_info_dict
is
None
or
pdf_info_dict
.
get
(
"_need_drop"
,
False
)
or
not_printable_rate
>
0.1
:
logger
.
warning
(
f
"parse_pdf_by_txt drop or error or garbled_rate too large, switch to parse_pdf_by_ocr"
)
logger
.
warning
(
f
"parse_pdf_by_txt drop or error or garbled_rate too large, switch to parse_pdf_by_ocr"
)
...
...
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