Commit d5148124 authored by 郭羽's avatar 郭羽

美购精排模型

parent 11456633
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"
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
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... "
...@@ -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
......
...@@ -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("读取数据...")
......
SERVICE_VERSION="v1"
SERVICE_MODEL_PATH = "/srv/apps/tensorServing_models/service"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment