Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
bom_identify
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
aa3481ef
authored
Jun 10, 2020
by
lichenggang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
全pcs列,即单位
parent
361d96f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
predict/base_handler.py
predict/dict_predict.py
predict/base_handler.py
View file @
aa3481ef
...
@@ -175,5 +175,18 @@ class BasePredictor:
...
@@ -175,5 +175,18 @@ class BasePredictor:
if
pat
.
findall
(
str
(
i
)):
if
pat
.
findall
(
str
(
i
)):
count
+=
1
count
+=
1
return
round
(
count
/
len
(
data
),
3
)
>=
REF_LEVEL
or
False
return
round
(
count
/
len
(
data
),
3
)
>=
REF_LEVEL
or
False
@classmethod
def
is_pcs
(
self
,
data
):
"""
pcs列
"""
PCS_LEVEL
=
0.5
count
=
0
for
i
in
data
:
if
str
(
i
)
.
lower
()
.
strip
()
==
'pcs'
:
count
+=
1
return
round
(
count
/
len
(
data
),
3
)
>=
PCS_LEVEL
or
False
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
print
(
BasePredictor
.
is_num
([
3400.0
,
5920.0
,
4849.0
,
2544.0
,
3270.0
,
52751.0
,
2031.0
,
5302.0
,
726.0
,
1247.0
,
2472.0
,
689.0
,
6049.0
,
26796.0
,
6164.0
,
1605.0
,
4346.0
,
640.0
,
960.0
,
960.0
,
320.0
,
160.0
,
860.0
,
160.0
,
320.0
,
3183.0
,
10151.0
,
640.0
,
130.0
,
1237.0
,
800.0
,
960.0
,
3740.0
,
17701.0
,
2146.0
,
1280.0
,
160.0
,
1120.0
,
160.0
,
480.0
,
960.0
,
480.0
,
160.0
,
4717.0
,
160.0
,
160.0
,
160.0
,
640.0
,
160.0
,
320.0
,
160.0
,
160.0
,
800.0
,
800.0
,
480.0
,
1600.0
,
155.0
,
960.0
,
320.0
,
944.0
,
160.0
,
160.0
,
1280.0
,
1852.0
,
7680.0
,
7680.0
,
2880.0
,
160.0
,
224.0
,
480.0
,
480.0
,
640.0
,
160.0
,
640.0
,
320.0
,
1760.0
,
640.0
,
480.0
,
960.0
,
160.0
,
160.0
,
160.0
,
160.0
,
1920.0
,
160.0
,
5600.0
,
480.0
,
2560.0
,
160.0
,
160.0
,
160.0
,
160.0
,
160.0
,
1280.0
,
160.0
,
160.0
,
160.0
,
160.0
,
160.0
,
320.0
,
0.0
,
160.0
,
160.0
]))
print
(
BasePredictor
.
is_num
([
3400.0
,
5920.0
,
4849.0
,
2544.0
,
3270.0
,
52751.0
,
2031.0
,
5302.0
,
726.0
,
1247.0
,
2472.0
,
689.0
,
6049.0
,
26796.0
,
6164.0
,
1605.0
,
4346.0
,
640.0
,
960.0
,
960.0
,
320.0
,
160.0
,
860.0
,
160.0
,
320.0
,
3183.0
,
10151.0
,
640.0
,
130.0
,
1237.0
,
800.0
,
960.0
,
3740.0
,
17701.0
,
2146.0
,
1280.0
,
160.0
,
1120.0
,
160.0
,
480.0
,
960.0
,
480.0
,
160.0
,
4717.0
,
160.0
,
160.0
,
160.0
,
640.0
,
160.0
,
320.0
,
160.0
,
160.0
,
800.0
,
800.0
,
480.0
,
1600.0
,
155.0
,
960.0
,
320.0
,
944.0
,
160.0
,
160.0
,
1280.0
,
1852.0
,
7680.0
,
7680.0
,
2880.0
,
160.0
,
224.0
,
480.0
,
480.0
,
640.0
,
160.0
,
640.0
,
320.0
,
1760.0
,
640.0
,
480.0
,
960.0
,
160.0
,
160.0
,
160.0
,
160.0
,
1920.0
,
160.0
,
5600.0
,
480.0
,
2560.0
,
160.0
,
160.0
,
160.0
,
160.0
,
160.0
,
1280.0
,
160.0
,
160.0
,
160.0
,
160.0
,
160.0
,
320.0
,
0.0
,
160.0
,
160.0
]))
predict/dict_predict.py
View file @
aa3481ef
...
@@ -100,6 +100,9 @@ class DicPredict(BasePredictor):
...
@@ -100,6 +100,9 @@ class DicPredict(BasePredictor):
if
self
.
is_ref
(
no_null_v
):
if
self
.
is_ref
(
no_null_v
):
ab_result
[
k
]
=
'位号'
ab_result
[
k
]
=
'位号'
continue
continue
if
self
.
is_pcs
(
no_null_v
):
ab_result
[
k
]
=
'单位'
continue
if
bol
:
if
bol
:
prob_columns
.
append
(
k
)
prob_columns
.
append
(
k
)
...
...
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