Browse Source

update video_rank

linfan 1 year ago
parent
commit
8c91d460c2
1 changed files with 4 additions and 3 deletions
  1. 4 3
      video_rank.py

+ 4 - 3
video_rank.py

@@ -713,11 +713,11 @@ def video_sanke_rank(data, size, top_K, flow_pool_P, ab_Code=''):
     hot_recall = []
     w2v_recall =[]
 
-    if ab_Code=='60058':
+    if ab_Code==60058:
         if len(data['hot_recall'])>0:
             hot_recall = sorted(data['hot_recall'], key=lambda k: k.get('rovScore', 0), reverse=True)
             recall_dict['hot_recall'] = hot_recall
-    elif ab_Code=='60059':
+    elif ab_Code==60059:
         if len(data['w2v_recall']>0):
            w2v_recall = sorted(data['w2v_recall'], key=lambda k: k.get('rovScore', 0), reverse=True)
            recall_dict['w2v_recall'] = w2v_recall
@@ -734,7 +734,8 @@ def video_sanke_rank(data, size, top_K, flow_pool_P, ab_Code=''):
             per_recall_name =  per_recall_item[0]
             per_recall_freq = per_recall_item[1]
             per_limt_num =  per_recall_item[2]
-            rand_num = random.random()
+            #rand_num = random.random()
+            rand_num = 0.2
             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)