瀏覽代碼

召回改造

zhangbo 1 年之前
父節點
當前提交
fe6d02bccc

+ 2 - 1
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/strategy/RegionRealtimeRecallStrategyV1.java

@@ -69,7 +69,8 @@ public class RegionRealtimeRecallStrategyV1 implements RecallStrategy {
         obj.put("name", "RegionRealtimeRecallStrategyV1");
         obj.put("filter_time", t2-t1);
         obj.put("provinceCn", provinceCn);
-        obj.put("size", videoids.size());
+        obj.put("sizeOld", videoMap.size());
+        obj.put("sizeNew", videoids.size());
         log.info(obj.toString());
         List<Video> videosResult = new ArrayList<>();
         videoids.stream().forEach(vid -> {

+ 4 - 1
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/strategy/RegionRealtimeRecallStrategyV3.java

@@ -56,10 +56,12 @@ public class RegionRealtimeRecallStrategyV3 implements RecallStrategy {
         long t2 = new Long(System.currentTimeMillis());
         JSONObject obj = new JSONObject();
         obj.put("name", "RegionRealtimeRecallStrategyV3");
+        obj.put("provinceCn", provinceCn);
+        obj.put("sizeOld", videoMap.size());
         obj.put("filter_time", t2-t1);
-        log.info(obj.toString());
         List<Video> videosResult = new ArrayList<>();
         if (filterResult != null && CollectionUtils.isNotEmpty(filterResult.getVideoIds())) {
+            obj.put("sizeNew", filterResult.getVideoIds().size());
             filterResult.getVideoIds().stream().forEach(vid -> {
                 Video video = new Video();
                 video.setVideoId(vid);
@@ -69,6 +71,7 @@ public class RegionRealtimeRecallStrategyV3 implements RecallStrategy {
                 videosResult.add(video);
             });
         }
+        log.info(obj.toString());
         Collections.sort(videosResult, Comparator.comparingDouble(o -> -o.getRovScore()));
         return videosResult;
     }