فهرست منبع

feat:修改补数据脚本

zhaohaipeng 3 ماه پیش
والد
کامیت
ccab5926a3
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/main/java/examples/extractor/v20250218/ExtractFeature20250218.java

+ 2 - 2
src/main/java/examples/extractor/v20250218/ExtractFeature20250218.java

@@ -229,8 +229,8 @@ public class ExtractFeature20250218 {
         for (String key : Arrays.asList("c6", "c7")) {
             for (String action : Arrays.asList("share", "return")) {
                 String featureKey = key + "_" + action;
-                if (map.containsKey(featureKey)) {
-                    Map<String, String[]> cfMap = map.get(featureKey);
+                Map<String, String[]> cfMap = map.getOrDefault(featureKey, new HashMap<>());
+                if (cfMap.containsKey(vid)) {
                     String[] scores = cfMap.get(vid);
                     featureMap.put(featureKey + "_score", Double.parseDouble(scores[0]));
                     featureMap.put(featureKey + "_num", Double.parseDouble(scores[1]));