|
|
@@ -13,6 +13,12 @@ public class ConvertV1 {
|
|
|
// String mid = record.get("mid");
|
|
|
Map<String, String> total_stat = ConvertUtils.getRecordCol(record, "total_stat");
|
|
|
double total = Double.parseDouble(total_stat.get("total"));
|
|
|
+ double weight;
|
|
|
+ if (total_stat.containsKey("weight")) {
|
|
|
+ weight = Double.parseDouble(total_stat.get("weight"));
|
|
|
+ } else {
|
|
|
+ weight = total;
|
|
|
+ }
|
|
|
long behaviorMs = Long.parseLong(total_stat.get("ts")) * 1000;
|
|
|
|
|
|
// context
|
|
|
@@ -20,19 +26,19 @@ public class ConvertV1 {
|
|
|
|
|
|
// cate1
|
|
|
Map<String, String> cate1_stat = ConvertUtils.getRecordCol(record, "cate1_stat");
|
|
|
- FeatureTransformV1.getCateFeature("cate1", total, cate1_stat, featMap);
|
|
|
+ FeatureTransformV1.getCateFeature("cate1", weight, cate1_stat, featMap);
|
|
|
|
|
|
// cate2
|
|
|
Map<String, String> cate2_stat = ConvertUtils.getRecordCol(record, "cate2_stat");
|
|
|
- FeatureTransformV1.getCateFeature("cate2", total, cate2_stat, featMap);
|
|
|
+ FeatureTransformV1.getCateFeature("cate2", weight, cate2_stat, featMap);
|
|
|
|
|
|
// title keywords
|
|
|
Map<String, String> title_keywords_stat = ConvertUtils.getRecordCol(record, "title_keywords_stat");
|
|
|
- FeatureTransformV1.getCateFeature("title_kw", total, title_keywords_stat, featMap);
|
|
|
+ FeatureTransformV1.getCateFeature("title_kw", weight, title_keywords_stat, featMap);
|
|
|
|
|
|
// title keywords
|
|
|
Map<String, String> video_keywords_stat = ConvertUtils.getRecordCol(record, "video_keywords_stat");
|
|
|
- FeatureTransformV1.getCateFeature("video_kw", total, video_keywords_stat, featMap);
|
|
|
+ FeatureTransformV1.getCateFeature("video_kw", weight, video_keywords_stat, featMap);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|