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
34bde6d8
Commit
34bde6d8
authored
Apr 08, 2024
by
赵小蒙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
classify后在jso根层级添加_pdf_type标识,同时取消对非文本类pdf的drop
parent
f65be6e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
pipeline.py
magic_pdf/pipeline.py
+4
-2
No files found.
magic_pdf/pipeline.py
View file @
34bde6d8
...
...
@@ -130,6 +130,7 @@ def classify_by_type(jso: dict, debug_mode=False) -> dict:
classify_time
=
int
(
time
.
time
()
-
start_time
)
# 计算执行时间
if
is_text_pdf
:
pdf_meta
[
"is_text_pdf"
]
=
is_text_pdf
jso
[
"_pdf_type"
]
=
"TXT"
jso
[
"pdf_meta"
]
=
pdf_meta
jso
[
"classify_time"
]
=
classify_time
# print(json.dumps(pdf_meta, ensure_ascii=False))
...
...
@@ -144,10 +145,11 @@ def classify_by_type(jso: dict, debug_mode=False) -> dict:
else
:
# 先不drop
pdf_meta
[
"is_text_pdf"
]
=
is_text_pdf
jso
[
"_pdf_type"
]
=
"OCR"
jso
[
"pdf_meta"
]
=
pdf_meta
jso
[
"classify_time"
]
=
classify_time
jso
[
"need_drop"
]
=
True
jso
[
"drop_reason"
]
=
DropReason
.
NOT_IS_TEXT_PDF
#
jso["need_drop"] = True
#
jso["drop_reason"] = DropReason.NOT_IS_TEXT_PDF
extra_info
=
{
"classify_rules"
:
[]}
for
condition
,
result
in
results
.
items
():
if
not
result
:
...
...
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