Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
00bb1843
authored
2021-06-11 15:54:34 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
change sheet name
1 parent
23c4a341
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
src/apps/doc/ocr/wb.py
src/apps/doc/ocr/wb.py
View file @
00bb184
...
...
@@ -17,7 +17,7 @@ class BSWorkbook(Workbook):
def
__init__
(
self
,
interest_keyword
,
salary_keyword
,
loan_keyword
,
wechat_keyword
,
*
args
,
**
kwargs
):
super
()
.
__init__
(
*
args
,
**
kwargs
)
locale
.
setlocale
(
locale
.
LC_NUMERIC
,
'en_US.UTF-8'
)
self
.
meta_sheet_title
=
'
关键信息提取和展示
'
self
.
meta_sheet_title
=
'
Key info
'
self
.
blank_row
=
(
None
,)
self
.
code_header
=
(
'页数'
,
'电子回单验证码'
)
self
.
date_header
=
(
'打印时间'
,
'起始日期'
,
'终止日期'
,
'流水区间结果'
)
...
...
@@ -45,7 +45,7 @@ class BSWorkbook(Workbook):
if
not
isinstance
(
card
,
str
):
return
consts
.
ERROR_CARD
try
:
new_card
=
card
.
translate
(
consts
.
SHEET_TITLE_TRANS
)
.
strip
()[
-
6
:]
new_card
=
card
.
translate
(
consts
.
SHEET_TITLE_TRANS
)
.
strip
()[
-
4
:]
if
len
(
new_card
)
==
0
:
new_card
=
consts
.
ERROR_CARD
except
Exception
as
e
:
...
...
@@ -327,9 +327,11 @@ class BSWorkbook(Workbook):
)
return
metadata_rows
def
build_meta_sheet
(
self
,
card
,
confidence
,
code
,
print_time
,
start_date
,
end_date
):
def
build_meta_sheet
(
self
,
role_name
,
card
,
confidence
,
code
,
print_time
,
start_date
,
end_date
):
metadata_rows
=
self
.
build_metadata_rows
(
confidence
,
code
,
print_time
,
start_date
,
end_date
)
ms
=
self
.
create_sheet
(
'{0}({1})'
.
format
(
self
.
meta_sheet_title
,
card
))
if
not
isinstance
(
role_name
,
str
):
role_name
=
consts
.
UNKNOWN_ROLE
ms
=
self
.
create_sheet
(
'{0}{1}({2})'
.
format
(
self
.
meta_sheet_title
,
role_name
,
card
))
for
row
in
metadata_rows
:
ms
.
append
(
row
)
return
ms
...
...
@@ -614,7 +616,8 @@ class BSWorkbook(Workbook):
# 2.元信息提取表
confidence
=
self
.
get_confidence
(
max_find_count
)
ms
=
self
.
build_meta_sheet
(
new_card
,
ms
=
self
.
build_meta_sheet
(
summary
.
get
(
'role'
,
consts
.
UNKNOWN_ROLE
),
new_card
,
confidence
,
summary
.
get
(
'code'
),
summary
.
get
(
'print_time'
),
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment