Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
serviceRec
Project
Project
Details
Activity
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
郭羽
serviceRec
Commits
d5148124
Commit
d5148124
authored
Jun 01, 2021
by
郭羽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
美购精排模型
parent
11456633
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
18 deletions
+23
-18
models_upload.sh
shell/models_upload.sh
+6
-0
service_train.sh
shell/service_train.sh
+5
-0
service_train_upload.sh
shell/service_train_upload.sh
+0
-12
featureEng.py
spark/featureEng.py
+3
-1
train_service.py
train/train_service.py
+6
-5
configUtils.py
utils/configUtils.py
+3
-0
No files found.
shell/models_upload.sh
0 → 100644
View file @
d5148124
service_modelPath
=
/srv/apps/tensorServing_models/service
cd
/srv/apps/tensorServing_models
#文件打包
tar
-czvf
model_service.tar.gz
$service_modelPath
#上传至coding
curl
-T
model_service.tar.gz
-u
guoyu@igengmei.com:Gengmei123!
"https://gengmei-generic.pkg.coding.net/tob/mode/service"
shell/service_train.sh
0 → 100644
View file @
d5148124
service_modelPath
=
/srv/apps/tensorServing_models/service
rm
-rf
$service_modelPath
/
*
source
/srv/envs/serviceRec/bin/activate
python /srv/apps/serviceRec/train/train_service.py
>
/srv/apps/serviceRec/logs/train_service_log.log
\ No newline at end of file
shell/service_train_upload.sh
deleted
100644 → 0
View file @
11456633
modelPath
=
/srv/apps/serviceRec/models/service
source
/srv/envs/serviceRec/bin/activate
rm
-rf
$modelPath
python /srv/apps/serviceRec/train/train_service.py
>
/srv/apps/serviceRec/logs/train_service_log.log
#文件打包
#tar -czvf model_service.tar.gz $modelPath
#上传至coding
#curl -T model_service.tar.gz -u guoyu@igengmei.com:Gengmei123! "https://gengmei-generic.pkg.coding.net/tob/mode/service"
#logging "upload model_service.tar.gz success... "
spark/featureEng.py
View file @
d5148124
...
@@ -22,6 +22,8 @@ import json
...
@@ -22,6 +22,8 @@ import json
sys
.
path
.
append
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))))
sys
.
path
.
append
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))))
import
utils.connUtils
as
connUtils
import
utils.connUtils
as
connUtils
import
utils.configUtils
as
configUtils
...
@@ -54,7 +56,7 @@ ITEM_NUMBER_COLUMNS = ["lowest_price","smart_rank2","case_count","ordered_user_i
...
@@ -54,7 +56,7 @@ ITEM_NUMBER_COLUMNS = ["lowest_price","smart_rank2","case_count","ordered_user_i
ITEM_CATE_COLUMNS
=
[
"service_type"
,
"doctor_type"
,
"doctor_id"
,
"doctor_famous"
,
"hospital_id"
,
"hospital_city_tag_id"
,
"hospital_type"
,
"hospital_is_high_quality"
]
ITEM_CATE_COLUMNS
=
[
"service_type"
,
"doctor_type"
,
"doctor_id"
,
"doctor_famous"
,
"hospital_id"
,
"hospital_city_tag_id"
,
"hospital_type"
,
"hospital_is_high_quality"
]
NUMBER_PRECISION
=
2
NUMBER_PRECISION
=
2
VERSION
=
"v1"
VERSION
=
configUtils
.
SERVICE_VERSION
FEATURE_USER_KEY
=
"Strategy:rec:feature:service:"
+
VERSION
+
":user:"
FEATURE_USER_KEY
=
"Strategy:rec:feature:service:"
+
VERSION
+
":user:"
FEATURE_ITEM_KEY
=
"Strategy:rec:feature:service:"
+
VERSION
+
":item:"
FEATURE_ITEM_KEY
=
"Strategy:rec:feature:service:"
+
VERSION
+
":item:"
FEATURE_VOCAB_KEY
=
"Strategy:rec:vocab:service:"
+
VERSION
FEATURE_VOCAB_KEY
=
"Strategy:rec:vocab:service:"
+
VERSION
...
...
train/train_service.py
View file @
d5148124
...
@@ -7,6 +7,7 @@ import os
...
@@ -7,6 +7,7 @@ import os
sys
.
path
.
append
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))))
sys
.
path
.
append
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))))
import
utils.connUtils
as
connUtils
import
utils.connUtils
as
connUtils
import
utils.configUtils
as
configUtils
ITEM_NUMBER_COLUMNS
=
[
"item_"
+
c
for
c
in
[
"smart_rank2"
]]
ITEM_NUMBER_COLUMNS
=
[
"item_"
+
c
for
c
in
[
"smart_rank2"
]]
embedding_columns
=
[
"itemid"
,
"userid"
]
+
[
"item_"
+
c
for
c
in
[
"doctor_id"
,
"hospital_id"
]]
embedding_columns
=
[
"itemid"
,
"userid"
]
+
[
"item_"
+
c
for
c
in
[
"doctor_id"
,
"hospital_id"
]]
...
@@ -18,11 +19,11 @@ one_hot_columns = ["item_"+c for c in ["service_type","doctor_type","doctor_famo
...
@@ -18,11 +19,11 @@ one_hot_columns = ["item_"+c for c in ["service_type","doctor_type","doctor_famo
# data_path_train = "/Users/zhigangzheng/Desktop/work/guoyu/service_sort/train/part-00000-a61205d1-ad4e-4fa7-895d-ad8db41189e6-c000.csv"
# data_path_train = "/Users/zhigangzheng/Desktop/work/guoyu/service_sort/train/part-00000-a61205d1-ad4e-4fa7-895d-ad8db41189e6-c000.csv"
# data_path_test = "/Users/zhigangzheng/Desktop/work/guoyu/service_sort/train/part-00000-a61205d1-ad4e-4fa7-895d-ad8db41189e6-c000.csv"
# data_path_test = "/Users/zhigangzheng/Desktop/work/guoyu/service_sort/train/part-00000-a61205d1-ad4e-4fa7-895d-ad8db41189e6-c000.csv"
version
=
"v1"
VERSION
=
configUtils
.
SERVICE_VERSION
trainDay
=
time
.
strftime
(
"
%
Y
%
m
%
d"
,
time
.
localtime
())
trainDay
=
time
.
strftime
(
"
%
Y
%
m
%
d"
,
time
.
localtime
())
data_path_train
=
"/data/files/service_feature_{}_train.csv"
.
format
(
version
)
data_path_train
=
"/data/files/service_feature_{}_train.csv"
.
format
(
VERSION
)
data_path_test
=
"/data/files/service_feature_{}_test.csv"
.
format
(
version
)
data_path_test
=
"/data/files/service_feature_{}_test.csv"
.
format
(
VERSION
)
model_file
=
"/srv/apps/serviceRec/models/service
/"
+
trainDay
model_file
=
configUtils
.
SERVICE_MODEL_PATH
+
"
/"
+
trainDay
def
is_float
(
s
):
def
is_float
(
s
):
try
:
try
:
...
@@ -199,7 +200,7 @@ if __name__ == '__main__':
...
@@ -199,7 +200,7 @@ if __name__ == '__main__':
# redis中加载数据字典
# redis中加载数据字典
print
(
"redis 中加载模型字典..."
)
print
(
"redis 中加载模型字典..."
)
data_vocab
=
getDataVocabFromRedis
(
version
)
data_vocab
=
getDataVocabFromRedis
(
VERSION
)
assert
data_vocab
assert
data_vocab
print
(
"读取数据..."
)
print
(
"读取数据..."
)
...
...
utils/configUtils.py
0 → 100644
View file @
d5148124
SERVICE_VERSION
=
"v1"
SERVICE_MODEL_PATH
=
"/srv/apps/tensorServing_models/service"
\ 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