Browse Source

video rank

linfan 1 year ago
parent
commit
f54160d8a6
1 changed files with 5 additions and 6 deletions
  1. 5 6
      video_rank.py

+ 5 - 6
video_rank.py

@@ -607,13 +607,12 @@ def video_new_rank2(data, size, top_K, flow_pool_P):
     redisObj = RedisHelper()
     vidKeys = []
     recall_list = []
-    for recalls in data['rov_pool_recall']:
-        if len(recalls)<=0:
+    for recall_item in data['rov_pool_recall']:
+        if len(recall_item)<=0:
             continue
-        for recall_item in recalls:
-            vid = recall_item.get("videoId",0)
-            vidKeys.append("k_p:" + str(vid))
-            recall_list.append(recall_item)
+        vid = recall_item.get("videoId",0)
+        vidKeys.append("k_p:" + str(vid))
+        recall_list.append(recall_item)
     # print("vidKeys:", vidKeys)
     video_scores = redisObj.get_batch_key(vidKeys)
     # print(video_scores)