|
@@ -73,11 +73,11 @@ public class ExtractFeature20250218 {
|
|
|
}
|
|
|
|
|
|
public static void handleVideoBasicFeature(Map<String, Object> videoFeature, long ts, Map<String, Object> featureMap) {
|
|
|
- Object totalTime = videoFeature.getOrDefault("total_time", "0");
|
|
|
+ Double totalTime = Double.parseDouble(videoFeature.getOrDefault("total_time", "0").toString());
|
|
|
Double width = Double.parseDouble(videoFeature.getOrDefault("width", "0d").toString());
|
|
|
Double height = Double.parseDouble(videoFeature.getOrDefault("height", "0d").toString());
|
|
|
- Object size = videoFeature.getOrDefault("size", "0d");
|
|
|
- Object bit_rate = videoFeature.getOrDefault("bit_rate", "0d");
|
|
|
+ Double size = Double.parseDouble(videoFeature.getOrDefault("size", "0d").toString());
|
|
|
+ Double bit_rate = Double.parseDouble(videoFeature.getOrDefault("bit_rate", "0d").toString());
|
|
|
String festiveLabel1 = videoFeature.getOrDefault("festive_label1", "").toString();
|
|
|
String festiveLabel2 = videoFeature.getOrDefault("festive_label2", "").toString();
|
|
|
|
|
@@ -97,8 +97,8 @@ public class ExtractFeature20250218 {
|
|
|
}
|
|
|
|
|
|
LocalDateTime now = LocalDateTime.ofInstant(Instant.ofEpochSecond(ts), ZoneId.systemDefault());
|
|
|
- featureMap.put("hour_" + now.getHour(), "0.1");
|
|
|
- featureMap.put("day_of_week" + now.getDayOfWeek(), "0.1");
|
|
|
+ featureMap.put("hour", now.getHour());
|
|
|
+ featureMap.put("day_of_week", now.getDayOfWeek());
|
|
|
|
|
|
long createTs = Long.parseLong(videoFeature.getOrDefault("gmt_create_timestamp", "0").toString());
|
|
|
featureMap.put("create_ts_diff", ExtractorUtils.getDaysBetween(createTs, ts));
|
|
@@ -255,9 +255,9 @@ public class ExtractFeature20250218 {
|
|
|
featureMap.put("d1_rov_cf_score", rovCfScores);
|
|
|
|
|
|
double rosCfRank = Double.parseDouble(d4Feature.getOrDefault("ros_cf_rank", "0").toString());
|
|
|
- featureMap.put("d1_ros_cf_rank", 1 / rosCfRank);
|
|
|
+ featureMap.put("d1_ros_cf_rank", ExtractorUtils.reciprocal(rosCfRank));
|
|
|
double rovCfRank = Double.parseDouble(d4Feature.getOrDefault("rov_cf_rank", "0").toString());
|
|
|
- featureMap.put("d1_rov_cf_rank", 1 / rovCfRank);
|
|
|
+ featureMap.put("d1_rov_cf_rank", ExtractorUtils.reciprocal(rovCfRank));
|
|
|
}
|
|
|
|
|
|
public static void handleD2(Map<String, Object> d5Feature, Map<String, Object> featureMap) {
|
|
@@ -265,7 +265,7 @@ public class ExtractFeature20250218 {
|
|
|
featureMap.put("d2_score", score);
|
|
|
|
|
|
double rank = Double.parseDouble(d5Feature.getOrDefault("rank", "0").toString());
|
|
|
- featureMap.put("d2_rank", 1 / rank);
|
|
|
+ featureMap.put("d2_rank", ExtractorUtils.reciprocal(rank));
|
|
|
}
|
|
|
|
|
|
public static void handleVideoSimilarity(Map<String, Object> videoFeature, Map<String, Object> headVideoFeature, Map<String, Object> featureMap) {
|