Explorar o código

平台推荐排序公式 v3: log 替代 sqrt + exposure<5000 过滤 + minScore 默认 0.0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
刘立冬 hai 13 horas
pai
achega
837d43965b

+ 3 - 0
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformVideoJob.java

@@ -83,6 +83,9 @@ public class ContentPlatformVideoJob {
                     Double score = Double.parseDouble((String) record.get(4));
                     Long exposure = parseLongSafe(record.get(5));
                     Double rovn = parseDoubleSafe(record.get(6));
+                    if (exposure < 5000) {
+                        continue;
+                    }
                     item.setDt(dt);
                     item.setVideoId(videoId);
                     item.setCategory(category);

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformApiServiceImpl.java

@@ -52,7 +52,7 @@ public class ContentPlatformApiServiceImpl implements ContentPlatformApiService
     @Autowired
     private RedisUtils redisUtils;
 
-    @Value("${video.min.score:0.5}")
+    @Value("${video.min.score:0.0}")
     private Double videoMinScore;
 
     @Override

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -105,7 +105,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Value("${vlog.share.appType:11}")
     private String shareAppType;
 
-    @Value("${video.min.score:0.5}")
+    @Value("${video.min.score:0.0}")
     private Double videoMinScore;
 
     @Value("${video.title.search.max.count:500}")

+ 1 - 1
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

@@ -263,7 +263,7 @@
         SELECT t.video_id, t.category, t.title, t.cover, t.video, round(t.weighted_score, 3) as score
         FROM (
         SELECT video_id, category, title, cover, video,
-            SUM(IFNULL(rovn, 0) * POW(GREATEST(IFNULL(exposure, 0) / 5000.0, 1.0), 0.5)
+            SUM(IFNULL(rovn, 0) * (1 + LN(GREATEST(IFNULL(exposure, 0) / 5000.0, 1.0)))
                 * POWER(0.9, DATEDIFF(STR_TO_DATE(#{aggDt}, '%Y%m%d'), STR_TO_DATE(dt, '%Y%m%d'))))
                 OVER (PARTITION BY video_id) AS weighted_score,
             ROW_NUMBER() OVER (PARTITION BY video_id ORDER BY dt DESC) AS rn