Browse Source

update rec

linfan 1 year ago
parent
commit
d828a34b43
2 changed files with 6 additions and 3 deletions
  1. 2 2
      recommend.py
  2. 4 1
      video_rank.py

+ 2 - 2
recommend.py

@@ -10,7 +10,7 @@ import config
 from log import Log
 from config import set_config
 from video_recall import PoolRecall
-from video_rank import video_new_rank2, video_sanke_rank,video_new_rank,video_rank,refactor_video_rank, bottom_strategy, video_rank_by_w_h_rate, video_rank_with_old_video, bottom_strategy2
+from video_rank import video_new_rank2, video_sank_pos_rank,video_new_rank,video_rank,refactor_video_rank, bottom_strategy, video_rank_by_w_h_rate, video_rank_with_old_video, bottom_strategy2
 from db_helper import RedisHelper
 import gevent
 from utils import FilterVideos, get_user_has30day_return
@@ -334,7 +334,7 @@ def video_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type, al
     #print("data['hot_recall']", data['hot_recall'])
     # 60058: u2itag, 60059:word2vec, 60061: sim_recall, 60062: u2u2i
     if ab_code == 60058 or ab_code == 60059 or ab_code == 60060 or ab_code == 60061 or ab_code == 60062:
-        rank_result, flow_num = video_sanke_rank(data=data, size=size, top_K=top_K, flow_pool_P=float(flow_pool_P), ab_Code=ab_code, exp_config=exp_config)
+        rank_result, flow_num = video_sank_pos_rank(data=data, size=size, top_K=top_K, flow_pool_P=float(flow_pool_P), ab_Code=ab_code, exp_config=exp_config)
         result['flow_num'] = flow_num
         if rank_result:
             result['rank_num'] = len(rank_result)

+ 4 - 1
video_rank.py

@@ -947,7 +947,10 @@ def video_sank_pos_rank(data, size, top_K, flow_pool_P, ab_Code='', exp_config=N
                    ('rov_recall_24h', 1), ('rov_recall_24h_dup', 1)]
     recall_pos4 = [('rov_recall_region_h', 0.98), ('rov_recall_24h', 0.2), ('rov_recall_region_24h', 1),
                    ('rov_recall_24h', 1), ('rov_recall_24h_dup', 1)]
-    if exp_config  and exp_config['recall_list']:
+    if exp_config  and 'recall_pos1' in exp_config \
+            and 'recall_pos2' in exp_config \
+            and 'recall_pos3' in exp_config \
+            and 'recall_pos4' in exp_config :
         recall_pos1 = exp_config['recall_pos1']
         recall_pos2 = exp_config['recall_pos2']
         recall_pos3 = exp_config['recall_pos3']