|
@@ -602,7 +602,7 @@ def video_new_rank2(data, size, top_K, flow_pool_P, ab_code, flowConfig=None):
|
|
|
:return: rank_result
|
|
|
"""
|
|
|
if not data['rov_pool_recall'] and not data['flow_pool_recall']:
|
|
|
- return []
|
|
|
+ return [], 0
|
|
|
|
|
|
redisObj = RedisHelper()
|
|
|
vidKeys = []
|
|
@@ -680,14 +680,14 @@ def video_new_rank2(data, size, top_K, flow_pool_P, ab_code, flowConfig=None):
|
|
|
flow_recall_rank.remove(flow_recall_rank[0])
|
|
|
else:
|
|
|
rank_result.extend(rov_recall_rank[:size - top_K - i])
|
|
|
- return rank_result[:size]
|
|
|
+ return rank_result[:size], flow_result
|
|
|
else:
|
|
|
if rov_recall_rank:
|
|
|
rank_result.append(rov_recall_rank[0])
|
|
|
rov_recall_rank.remove(rov_recall_rank[0])
|
|
|
else:
|
|
|
rank_result.extend(flow_recall_rank[:size - top_K - i])
|
|
|
- return rank_result[:size]
|
|
|
+ return rank_result[:size], flow_result
|
|
|
i += 1
|
|
|
return rank_result[:size], flow_result
|
|
|
|
|
@@ -701,8 +701,10 @@ def video_sanke_rank(data, size, top_K, flow_pool_P, ab_Code='', exp_config=None
|
|
|
:return: rank_result
|
|
|
"""
|
|
|
if not data['rov_pool_recall'] and not data['flow_pool_recall'] \
|
|
|
- and not data['hot_rcall'] and not data['hot_rcall']:
|
|
|
- return []
|
|
|
+ and not data['hot_rcall'] and not data['hot_rcall'] \
|
|
|
+ and not data['w2v_recall'] and not data['w2v_recall'] \
|
|
|
+ and not data['sim_recall'] and not data['sim_recall']:
|
|
|
+ return [], 0
|
|
|
# 地域分组小时级规则更新数据
|
|
|
recall_dict = {}
|
|
|
region_h_recall = [item for item in data['rov_pool_recall']
|
|
@@ -820,14 +822,14 @@ def video_sanke_rank(data, size, top_K, flow_pool_P, ab_Code='', exp_config=None
|
|
|
flow_recall_rank.remove(flow_recall_rank[0])
|
|
|
else:
|
|
|
rank_result.extend(rov_recall_rank[:size - top_K - i])
|
|
|
- return rank_result[:size]
|
|
|
+ return rank_result[:size], flow_result
|
|
|
else:
|
|
|
if rov_recall_rank:
|
|
|
rank_result.append(rov_recall_rank[0])
|
|
|
rov_recall_rank.remove(rov_recall_rank[0])
|
|
|
else:
|
|
|
rank_result.extend(flow_recall_rank[:size - top_K - i])
|
|
|
- return rank_result[:size]
|
|
|
+ return rank_result[:size], flow_result
|
|
|
i += 1
|
|
|
return rank_result[:size], flow_result
|
|
|
|