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
4e418107
authored
Jun 01, 2020
by
lichenggang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加静态的category, 固定逻辑对列进行判断前去掉占位符
parent
47957ad9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
predict/dict_predict.py
static_config.py
predict/dict_predict.py
View file @
4e418107
...
...
@@ -99,17 +99,18 @@ class DicPredict(BasePredictor):
temp_pre_model_res
=
{}
ab_result
=
{}
for
k
,
v
in
dic_data
.
items
():
no_null_v
=
list
(
filter
(
lambda
x
:
x
!=
self
.
PLACEHOLDER
,
v
))
bol
=
self
.
v_chain
(
v
)
if
self
.
is_seq
(
v
):
if
self
.
is_seq
(
no_null_
v
):
ab_result
[
k
]
=
'序号'
continue
if
self
.
is_num
(
v
):
if
self
.
is_num
(
no_null_
v
):
temp_pre_model_res
[
k
]
=
'数量'
continue
if
bol
:
prob_columns
.
append
(
k
)
continue
if
self
.
is_catecol
(
v
):
if
self
.
is_catecol
(
no_null_
v
):
temp_pre_model_res
[
k
]
=
'类别'
continue
not_null_dic_data
=
{
k
:
list
(
filter
(
lambda
x
:
x
!=
self
.
PLACEHOLDER
,
dic_data
[
k
]))
for
k
in
prob_columns
}
...
...
static_config.py
View file @
4e418107
...
...
@@ -32,4 +32,4 @@ CATEGORY = ["半导体", "嵌入式", "光电子", "光源", "无源", "连接
"铰接件"
,
"盖塞与遮蔽"
,
"支撑脚和轮"
,
"型材与座"
,
"减震器"
,
"轴承"
,
"把手"
,
"直线导轨"
,
"技术密封"
,
"切换夹具和夹紧螺栓"
,
"边缘保护套"
,
"磁铁"
,
"报警器"
,
"分线盒"
,
"变送器"
,
"调制与控制"
,
"气动"
,
"螺线管"
,
"启动器"
,
"阀门和汇流板"
,
"空气设备"
,
"仪表"
,
"气动配件"
,
"测量"
,
"软焊和焊接设备"
,
"PCB原型制作与生产"
,
"化学制剂"
,
"工具"
,
"防静电保护"
,
"健康与安全"
,
"收音机和CB用框架及半框架"
,
"扬声器罩,前面板固定座"
,
"排线"
,
"电机控制模块"
,
"微型电动机"
,
"底板"
,
"3D打印机"
,
"RTV服务"
,
"配件"
,
"三极管"
]
"RTV服务"
,
"配件"
,
"三极管"
,
'钽电容'
,
'MOS管'
,
'芯片'
,
'器件'
,
'模组'
,
'接线'
,
'按键'
]
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