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
671ce1d9
Commit
671ce1d9
authored
Mar 26, 2024
by
赵小蒙
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
6f80beaa
cb1b02e7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
pdf_parse_for_train.py
magic_pdf/pdf_parse_for_train.py
+1
-1
convert_to_train_format.py
magic_pdf/train_utils/convert_to_train_format.py
+2
-2
No files found.
magic_pdf/pdf_parse_for_train.py
View file @
671ce1d9
...
@@ -220,7 +220,7 @@ def parse_pdf_for_train(
...
@@ -220,7 +220,7 @@ def parse_pdf_for_train(
# 解析表格并对table_bboxes进行位置的微调,防止表格周围的文字被截断
# 解析表格并对table_bboxes进行位置的微调,防止表格周围的文字被截断
table_bboxes
=
parse_tables
(
page_id
,
page
,
model_output_json
)
table_bboxes
=
parse_tables
(
page_id
,
page
,
model_output_json
)
table_bboxes
=
fix_tables
(
table_bboxes
=
fix_tables
(
page
,
table_bboxes
,
include_table_title
=
Tru
e
,
scan_line_num
=
2
page
,
table_bboxes
,
include_table_title
=
Fals
e
,
scan_line_num
=
2
)
# 修正
)
# 修正
table_bboxes
=
fix_table_text_block
(
table_bboxes
=
fix_table_text_block
(
text_raw_blocks
,
table_bboxes
text_raw_blocks
,
table_bboxes
...
...
magic_pdf/train_utils/convert_to_train_format.py
View file @
671ce1d9
...
@@ -54,8 +54,8 @@ def convert_to_train_format(jso: dict) -> []:
...
@@ -54,8 +54,8 @@ def convert_to_train_format(jso: dict) -> []:
n_bbox
=
{
"category_id"
:
10
,
"bbox"
:
inter_equation
[
"bbox"
]}
n_bbox
=
{
"category_id"
:
10
,
"bbox"
:
inter_equation
[
"bbox"
]}
bboxes
.
append
(
n_bbox
)
bboxes
.
append
(
n_bbox
)
for
footnote
in
v
[
'bak_footer_note_bboxes'
]:
for
footnote
_bbox
in
v
[
"bak_footer_note_bboxes"
]:
n_bbox
=
{
"category_id"
:
5
,
"bbox"
:
footnote
[
"bbox"
]
}
n_bbox
=
{
"category_id"
:
5
,
"bbox"
:
list
(
footnote_bbox
)
}
bboxes
.
append
(
n_bbox
)
bboxes
.
append
(
n_bbox
)
info
[
"bboxes"
]
=
bboxes
info
[
"bboxes"
]
=
bboxes
...
...
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