linfan пре 1 година
родитељ
комит
2e98b82c5e
3 измењених фајлова са 9 додато и 9 уклоњено
  1. 4 4
      rank_service.py
  2. 3 3
      recommend.py
  3. 2 2
      video_rank.py

+ 4 - 4
rank_service.py

@@ -70,9 +70,9 @@ def get_featurs(mid, data, size, top_K, flow_pool_P, env_dict=None):
         sencetype_list.append(sencetype)
         vidKeys.append(pre_str + str(vid))
         recall_list.append(recall_item)
-    print("vidKeys:", vidKeys)
+    #print("vidKeys:", vidKeys)
     video_static_info = redisObj.get_batch_key(vidKeys)
-    print("video_static_info:",video_static_info)
+    #print("video_static_info:",video_static_info)
     if video_static_info:
         for i in range(len(video_static_info)):
             try:
@@ -182,7 +182,7 @@ def get_tf_serving_sores(feature_dict):
     request_data_dict["inputs"] = inputs_data
     #print(request_data_dict)
     request_data= json.dumps(request_data_dict)
-    print(request_data)
+    #print(request_data)
     # 调用http接口
     result = request_post_data(config_.TF_SERVING_URL,request_data, timeout=(0.1, 1))
 
@@ -191,5 +191,5 @@ def get_tf_serving_sores(feature_dict):
         print("result is None")
         log_.info('call tf serving error,types: {}')
         return []
-    print(result)
+    #print(result)
     return result

+ 3 - 3
recommend.py

@@ -452,7 +452,7 @@ def video_old_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type
 
     if app_type in [config_.APP_TYPE['LAO_HAO_KAN_VIDEO'], config_.APP_TYPE['ZUI_JING_QI']]:
         t = [gevent.spawn(pool_recall.rov_pool_recall_with_region, size, expire_time, ab_code, exp_config)]
-        if ab_code ==60054 :
+        if ab_code ==60054 or ab_code==60066:
             t.append(gevent.spawn(pool_recall.get_sim_hot_item_reall_filter, exp_config))
         if ab_code == 60055:
             t.append(gevent.spawn(pool_recall.get_return_video_reall, exp_config))
@@ -470,7 +470,7 @@ def video_old_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type
         t = [gevent.spawn(pool_recall.rov_pool_recall_with_region, size, expire_time, ab_code, exp_config),
              gevent.spawn(pool_recall.flow_pool_recall, size, config_.QUICK_FLOW_POOL_ID),
              gevent.spawn(pool_recall.flow_pool_recall, size)]
-        if  ab_code == 60054:
+        if  ab_code == 60054 or ab_code==60066:
             t.append(gevent.spawn(pool_recall.get_sim_hot_item_reall_filter))
         if ab_code == 60055:
             t.append(gevent.spawn(pool_recall.get_return_video_reall, exp_config))
@@ -494,7 +494,7 @@ def video_old_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type
         result['rankResult'] = []
         return result
     #1. merge simrecall
-    if ab_code == 60054:
+    if ab_code == 60054 or ab_code==60066:
         rov_pool_recall = []
         if len(recall_result_list) >= 2:
             region_recall = recall_result_list[0]

+ 2 - 2
video_rank.py

@@ -634,7 +634,7 @@ def video_new_rank2(data, size, top_K, flow_pool_P, ab_code, mid, exp_config=Non
         if score_result and len(score_result) > 0 and len(score_result) == len(recall_list):
             for i in range(len(score_result)):
                 recall_list[i]['sort_score'] = score_result[i][0]
-                print(score_result[i][0])
+                #print(score_result[i][0])
             rov_recall_rank = sorted(recall_list, key=lambda k: k.get('sort_score', 0), reverse=True)
     else:
         redisObj = RedisHelper()
@@ -658,7 +658,7 @@ def video_new_rank2(data, size, top_K, flow_pool_P, ab_code, mid, exp_config=Non
                 except Exception:
                     recall_list[i]['sort_score'] = 0.0
             rov_recall_rank = sorted(recall_list, key=lambda k: k.get('sort_score', 0), reverse=True)
-    print(rov_recall_rank)
+    #print(rov_recall_rank)
     flow_recall_rank = sorted(data['flow_pool_recall'], key=lambda k: k.get('rovScore', 0), reverse=True)
     rov_recall_rank, flow_recall_rank = remove_duplicate(rov_recall=rov_recall_rank, flow_recall=flow_recall_rank,
                                                      top_K=top_K)