linfan hace 2 años
padre
commit
4fd83b8cd5
Se han modificado 2 ficheros con 4 adiciones y 4 borrados
  1. 1 1
      recommend.py
  2. 3 3
      video_recall.py

+ 1 - 1
recommend.py

@@ -180,7 +180,7 @@ def video_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type, al
     pool_recall = PoolRecall(request_id=request_id,
                              app_type=app_type, mid=mid, uid=uid, ab_code=ab_code,
                              client_info=client_info, rule_key=rule_key, data_key=data_key, no_op_flag=no_op_flag,
-                             params=params, rule_key_30day=rule_key_30day, shield_config=shield_config)
+                             params=params, rule_key_30day=rule_key_30day, shield_config=shield_config, video_id= video_id)
     # _, last_rov_recall_key, _ = pool_recall.get_video_last_idx()
     # # 小时级实验
     # if ab_code in [code for _, code in config_.AB_CODE['rank_by_h'].items()]:

+ 3 - 3
video_recall.py

@@ -17,7 +17,7 @@ config_ = set_config()
 class PoolRecall(object):
     """召回"""
     def __init__(self, request_id, app_type, client_info=None, mid='', uid='', ab_code='',
-                 rule_key='', data_key='', no_op_flag=False, params=None, rule_key_30day=None, shield_config=None):
+                 rule_key='', data_key='', no_op_flag=False, params=None, rule_key_30day=None, shield_config=None, video_id=None):
         """
         初始化
         :param request_id: request_id
@@ -2106,8 +2106,8 @@ class PoolRecall(object):
         return pool_recall_result[:size]
 
     #linfan
-    def get_sim_hot_item_reall(self, mainVid):
-        recall_key = "sim_hot_"+str(mainVid)
+    def get_sim_hot_item_reall(self):
+        recall_key = "sim_hot_"+str(self.video_id)
         print("recall_key:", recall_key)
         data = self.redis_helper.get_data_from_redis(key_name=recall_key)
         print(data)