|
@@ -30,8 +30,9 @@ public class FeatureTransformV2 {
|
|
private static final List<String> hVideoSimAttrs = Arrays.asList("title");
|
|
private static final List<String> hVideoSimAttrs = Arrays.asList("title");
|
|
private static final List<String> cfList = Arrays.asList("share", "return");
|
|
private static final List<String> cfList = Arrays.asList("share", "return");
|
|
private static final List<String> userAttrList = Arrays.asList("province", "city", "model", "brand", "system");
|
|
private static final List<String> userAttrList = Arrays.asList("province", "city", "model", "brand", "system");
|
|
|
|
+ private static final Set<String> hotSceneSet = new HashSet<>(Arrays.asList("1008", "1007", "1058", "1074", "1010"));
|
|
|
|
|
|
- public static void getContextFeature(long currentMs, Map<String, Double> featureMap) {
|
|
|
|
|
|
+ public static void getContextFeature(long currentMs, String appType, String hotSceneType, Map<String, Double> featureMap) {
|
|
Calendar calendar = Calendar.getInstance();
|
|
Calendar calendar = Calendar.getInstance();
|
|
calendar.setTimeInMillis(currentMs);
|
|
calendar.setTimeInMillis(currentMs);
|
|
|
|
|
|
@@ -40,6 +41,14 @@ public class FeatureTransformV2 {
|
|
featureMap.put(String.format("%s@%d", "week", week), 1.0);
|
|
featureMap.put(String.format("%s@%d", "week", week), 1.0);
|
|
featureMap.put(String.format("%s@%d", "hour", hour), 1.0);
|
|
featureMap.put(String.format("%s@%d", "hour", hour), 1.0);
|
|
featureMap.put("hour", hour * 1.0);
|
|
featureMap.put("hour", hour * 1.0);
|
|
|
|
+ featureMap.put(String.format("%s@%s", "app", appType), 1.0);
|
|
|
|
+ String hot;
|
|
|
|
+ if (hotSceneSet.contains(hotSceneType)) {
|
|
|
|
+ hot = hotSceneType;
|
|
|
|
+ } else {
|
|
|
|
+ hot = "other";
|
|
|
|
+ }
|
|
|
|
+ featureMap.put(String.format("%s@%s", "hot", hot), 1.0);
|
|
}
|
|
}
|
|
|
|
|
|
public static void getUserFeature(Map<String, Map<String, String>> userOriginInfo, Map<String, Double> featMap) {
|
|
public static void getUserFeature(Map<String, Map<String, String>> userOriginInfo, Map<String, Double> featMap) {
|