|
@@ -637,7 +637,7 @@ def video_new_rank2(data, size, top_K, flow_pool_P, ab_code, mid, exp_config=Non
|
|
|
if (ab_code == 60066 or ab_code == 60069 or ab_code == 60070 or ab_code == 60071) and len(rec_recall_vid_list)>0:
|
|
|
video_static_info = redisObj.get_batch_key(day_vidKeys)
|
|
|
video_hour_static_info = redisObj.get_batch_key(hour_vidKeys)
|
|
|
- print("env_dict:", env_dict)
|
|
|
+ #print("env_dict:", env_dict)
|
|
|
feature_dict = get_featurs(mid, data, size, top_K, flow_pool_P, rec_recall_vid_list,env_dict, video_static_info, video_hour_static_info)
|
|
|
score_result = get_tf_serving_sores(feature_dict)
|
|
|
if video_scores and len(video_scores)>0 and rec_recall_item_list and score_result and len(score_result) > 0\
|
|
@@ -646,19 +646,30 @@ def video_new_rank2(data, size, top_K, flow_pool_P, ab_code, mid, exp_config=Non
|
|
|
try:
|
|
|
if video_scores[i] is None and len(score_result[i])>0:
|
|
|
return_score = 0.000000001
|
|
|
- total_score = return_score * score_result[i][0]
|
|
|
+ # sore_index :10 = model score
|
|
|
+ if sort_index == 10:
|
|
|
+ total_score = score_result[i][0]
|
|
|
+ else:
|
|
|
+ total_score = return_score * score_result[i][0]
|
|
|
rec_recall_item_list[i]['sort_score'] = total_score
|
|
|
else:
|
|
|
video_score_str = json.loads(video_scores[i])
|
|
|
- if len(video_score_str)>= sort_index and len(video_score_str)>0:
|
|
|
- return_score = video_score_str[sort_index]
|
|
|
+ # sore_index :10 = model score
|
|
|
+ if sort_index == 10:
|
|
|
+ total_score = score_result[i][0]
|
|
|
else:
|
|
|
- return_score = 0.000000001
|
|
|
- total_score = return_score * score_result[i][0]
|
|
|
+ if len(video_score_str)>= sort_index and len(video_score_str)>0:
|
|
|
+ return_score = video_score_str[sort_index]
|
|
|
+ else:
|
|
|
+ return_score = 0.000000001
|
|
|
+ total_score = return_score * score_result[i][0]
|
|
|
rec_recall_item_list[i]['sort_score'] = total_score
|
|
|
except Exception:
|
|
|
- return_score = 0.000000001
|
|
|
- total_score = return_score * 0.00000001
|
|
|
+ if sort_index == 10:
|
|
|
+ total_score = 0.00000001
|
|
|
+ else:
|
|
|
+ return_score = 0.000000001
|
|
|
+ total_score = return_score * 0.00000001
|
|
|
rec_recall_item_list[i]['sort_score'] = total_score
|
|
|
rec_recall_item_list[i]['flag_call_service'] = 1
|
|
|
rov_recall_rank = sorted(rec_recall_item_list, key=lambda k: k.get('sort_score', 0), reverse=True)
|