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
fadba796
authored
Jul 01, 2020
by
lichenggang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
暂时让数量列阈值为0.5
parent
4bef8d18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
predict/base_handler.py
predict/base_handler.py
View file @
fadba796
...
...
@@ -11,9 +11,8 @@ from utils.log_manager import get_logger
from
utils.robots
import
dd_send_msg
import
pandas
as
pd
from
static_config
import
*
from
utils.status
import
StatusCode
,
code2msg
# 数量列阈值
RIGHT_LEVEL
=
0.
7
RIGHT_LEVEL
=
0.
5
# 序号列阈值
SEQ_LEVEL
=
0.5
# 类别列阈值
...
...
@@ -96,7 +95,6 @@ class BasePredictor(metaclass=ClassBasePredictorMeta):
"""
数量列预测
"""
def
isNumberCol
(
kw
):
"""
是否是数量列辅助函数
...
...
@@ -292,6 +290,6 @@ class BasePredictor(metaclass=ClassBasePredictorMeta):
return
round
(
count
/
len
(
data
),
3
)
>=
SIMPLE_ENCAP_LEVEL
if
__name__
==
"__main__"
:
print
(
BasePredictor
.
is_num
([
'
1k'
,
'1k'
,
'1k'
,
'1k'
]))
print
(
BasePredictor
.
is_num
([
'
数量'
,
1000
]))
print
(
re
.
match
(
r'(\d+|\d+(\.\d+))($|(K)|[个十百千万])$'
,
'1k'
,
re
.
M
|
re
.
I
))
\ No newline at end of file
# print(re.match(r'(\d+|\d+(\.\d+))($|(K)|[个十百千万])$', '1k', re.M | re.I))
\ No newline at end of file
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