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
496045f3
Commit
496045f3
authored
May 31, 2024
by
赵小蒙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
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.15
# 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