|
@@ -29,6 +29,7 @@ public class FeatureTransformV2 {
|
|
|
private static final List<String> hVideoSimAttrs = Arrays.asList("title");
|
|
|
private static final List<String> cfList = Arrays.asList("share", "return");
|
|
|
private static final List<String> userAttrList = Arrays.asList("province", "city", "model", "brand", "system", "user_channel", "user_level");
|
|
|
+ private static final Set<String> appSet = new HashSet<>(Arrays.asList("0", "2", "4"));
|
|
|
private static final Set<String> hotSceneSet = new HashSet<>(Arrays.asList("1008", "1007", "1058", "1074", "1010"));
|
|
|
|
|
|
public static void getContextFeature(long currentMs, String appType, String hotSceneType, Map<String, Double> featureMap) {
|
|
@@ -40,7 +41,13 @@ public class FeatureTransformV2 {
|
|
|
featureMap.put(String.format("%s@%d", "week", week), 1.0);
|
|
|
featureMap.put(String.format("%s@%d", "hour", hour), 1.0);
|
|
|
featureMap.put("hour", hour * 1.0);
|
|
|
- featureMap.put(String.format("%s@%s", "app", appType), 1.0);
|
|
|
+ String app;
|
|
|
+ if (appSet.contains(appType)) {
|
|
|
+ app = appType;
|
|
|
+ } else {
|
|
|
+ app = "other";
|
|
|
+ }
|
|
|
+ featureMap.put(String.format("%s@%s", "app", app), 1.0);
|
|
|
String hot;
|
|
|
if (hotSceneSet.contains(hotSceneType)) {
|
|
|
hot = hotSceneType;
|