linfan il y a 1 an
Parent
commit
d21c694b65
3 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. 1 0
      config.py
  2. 1 0
      video_rank.py
  3. 3 3
      video_recall.py

+ 1 - 0
config.py

@@ -459,6 +459,7 @@ class BaseConfig(object):
         'normal_flow_recall': 'normal_flow_recall',  # 普通流量池召回
         'hot_3_day_recall': 'hot_3_day_recall',  # 3天召回
         'hot_recall': 'hot_recall',  # hot召回
+        'w2v_recall': 'w2v_recall', #word2vec
     }
 
     # category id mapping

+ 1 - 0
video_rank.py

@@ -737,6 +737,7 @@ def video_sanke_rank(data, size, top_K, flow_pool_P, ab_Code=''):
             rand_num = random.random()
             if rand_num<per_recall_freq and per_recall_name in recall_dict:
                 per_recall = recall_dict[per_recall_name]
+                print("per_recall_item:", per_recall_item, per_recall)
                 cur_recall_num = 0
                 for recall_item in per_recall:
                     vid = recall_item['videoId']

+ 3 - 3
video_recall.py

@@ -2489,15 +2489,15 @@ class PoolRecall(object):
         recall_result = []
         recall_dict  = {}
         video_ids = []
-        if data is not None:
-            json_result = data.split(",")
+        if data is not None and data.strip()!="":
+            json_result = data.strip().split(",")
             # print("json_result:", json_result)
             for per_item in json_result:
                 try:
                     vid = int(per_item)
                     video_ids.append(vid)
                     recall_dict[vid] = {'videoId': vid, 'flowPool': '',
-                         'rovScore': 0.0, 'pushFrom': config_.PUSH_FROM['sim_hot_vid_recall'],
+                         'rovScore': 0.0, 'pushFrom': config_.PUSH_FROM['w2v_recall'],
                          'abCode': self.ab_code}
                 except Exception as e:
                     continue