|
@@ -371,6 +371,8 @@ def video_homepage_recommend(mid, uid, size, app_type, algo_type, client_info, a
|
|
|
size = size
|
|
|
top_K = config_.K
|
|
|
flow_pool_P = config_.P
|
|
|
+ ab_code = config_.AB_CODE['initial']
|
|
|
+ expire_time = 24 * 3600
|
|
|
else:
|
|
|
ab_exp_code_list = []
|
|
|
config_value_dict = {}
|
|
@@ -383,6 +385,7 @@ def video_homepage_recommend(mid, uid, size, app_type, algo_type, client_info, a
|
|
|
continue
|
|
|
ab_exp_code_list.append(str(ab_exp_code))
|
|
|
config_value_dict[str(ab_exp_code)] = ab_item.get('configValue', None)
|
|
|
+ # 推荐条数 10->4 实验
|
|
|
if config_.AB_EXP_CODE['rec_size_home'] in ab_exp_code_list:
|
|
|
config_value = config_value_dict.get(config_.AB_EXP_CODE['rec_size_home'], None)
|
|
|
if config_value:
|
|
@@ -398,10 +401,19 @@ def video_homepage_recommend(mid, uid, size, app_type, algo_type, client_info, a
|
|
|
top_K = config_.K
|
|
|
flow_pool_P = config_.P
|
|
|
|
|
|
+ # 小时级更新-规则1 实验
|
|
|
+ if config_.AB_EXP_CODE['rule_rank1'] in ab_exp_code_list:
|
|
|
+ ab_code = config_.AB_CODE['rank_by_h']
|
|
|
+ expire_time = 3600
|
|
|
+ else:
|
|
|
+ ab_code = config_.AB_CODE['initial']
|
|
|
+ expire_time = 24 * 3600
|
|
|
+
|
|
|
# 简单召回 - 排序 - 兜底
|
|
|
rank_result, last_rov_recall_key = video_recommend(mid=mid, uid=uid, app_type=app_type,
|
|
|
size=size, top_K=top_K, flow_pool_P=flow_pool_P,
|
|
|
- algo_type=algo_type, client_info=client_info)
|
|
|
+ algo_type=algo_type, client_info=client_info,
|
|
|
+ ab_code=ab_code, expire_time=expire_time)
|
|
|
# ab-test
|
|
|
# result = ab_test_op(rank_result=rank_result,
|
|
|
# ab_code_list=[config_.AB_CODE['position_insert']],
|
|
@@ -429,6 +441,8 @@ def video_relevant_recommend(video_id, mid, uid, size, app_type, ab_exp_info):
|
|
|
size = size
|
|
|
top_K = config_.K
|
|
|
flow_pool_P = config_.P
|
|
|
+ ab_code = config_.AB_CODE['initial']
|
|
|
+ expire_time = 24 * 3600
|
|
|
else:
|
|
|
ab_exp_code_list = []
|
|
|
config_value_dict = {}
|
|
@@ -441,6 +455,8 @@ def video_relevant_recommend(video_id, mid, uid, size, app_type, ab_exp_info):
|
|
|
continue
|
|
|
ab_exp_code_list.append(str(ab_exp_code))
|
|
|
config_value_dict[str(ab_exp_code)] = ab_item.get('configValue', None)
|
|
|
+
|
|
|
+ # 推荐条数 10->4 实验
|
|
|
if config_.AB_EXP_CODE['rec_size_relevant'] in ab_exp_code_list:
|
|
|
config_value = config_value_dict.get(config_.AB_EXP_CODE['rec_size_relevant'], None)
|
|
|
if config_value:
|
|
@@ -456,10 +472,19 @@ def video_relevant_recommend(video_id, mid, uid, size, app_type, ab_exp_info):
|
|
|
top_K = config_.K
|
|
|
flow_pool_P = config_.P
|
|
|
|
|
|
+ # 小时级更新-规则1 实验
|
|
|
+ if config_.AB_EXP_CODE['rule_rank1'] in ab_exp_code_list:
|
|
|
+ ab_code = config_.AB_CODE['rank_by_h']
|
|
|
+ expire_time = 3600
|
|
|
+ else:
|
|
|
+ ab_code = config_.AB_CODE['initial']
|
|
|
+ expire_time = 24 * 3600
|
|
|
+
|
|
|
# 简单召回 - 排序 - 兜底
|
|
|
rank_result, last_rov_recall_key = video_recommend(mid=mid, uid=uid, app_type=app_type,
|
|
|
size=size, top_K=top_K, flow_pool_P=flow_pool_P,
|
|
|
- algo_type='', client_info=None)
|
|
|
+ algo_type='', client_info=None,
|
|
|
+ ab_code=ab_code, expire_time=expire_time)
|
|
|
# ab-test
|
|
|
# result = ab_test_op(rank_result=rank_result,
|
|
|
# ab_code_list=[config_.AB_CODE['position_insert'], config_.AB_CODE['relevant_video_op']],
|