|
@@ -30,6 +30,7 @@ public class FeatureTransformV2 {
|
|
|
private static final List<String> videoCateAttrs = Arrays.asList(FeatureUtils.cate1Attr, FeatureUtils.cate2Attr, FeatureUtils.festive1Attr,
|
|
|
FeatureUtils.channelAttr, FeatureUtils.sourceAttr, FeatureUtils.uidAttr, FeatureUtils.mergeCate1Attr, FeatureUtils.mergeCate2Attr);
|
|
|
private static final List<String> videoSimAttrs = Arrays.asList("title", "cate2", "cate2_list", "keywords");
|
|
|
+ private static final List<String> creativeSimAttrs = 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> userAttrList = Arrays.asList("province", "city", "model", "brand", "system", "user_channel", "user_level");
|
|
@@ -245,6 +246,20 @@ public class FeatureTransformV2 {
|
|
|
getTwoVideoCrossFeature("hr_sim", videoSimAttrs, headInfo, rankInfo, featMap);
|
|
|
}
|
|
|
|
|
|
+ public static void getCreativeFeature(String prefix, Map<String, String> creativeInfo, Map<String, String> rankInfo, Map<String, Double> featMap) {
|
|
|
+ if (null == creativeInfo || creativeInfo.isEmpty()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (creativeInfo.containsKey("ghId")) {
|
|
|
+ String ghId = creativeInfo.get("ghId");
|
|
|
+ if (null != ghId && !ghId.isEmpty()) {
|
|
|
+ String key = String.format("%s@%s", prefix, ghId);
|
|
|
+ featMap.put(key, 1.0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getTwoVideoCrossFeature(prefix, creativeSimAttrs, creativeInfo, rankInfo, featMap);
|
|
|
+ }
|
|
|
+
|
|
|
public static void getProfileVideoCrossFeature(long currentMs, UserShareReturnProfile profile, Map<String, String> rankVideo, Map<String, Map<String, String>> hVideoMap, Map<String, Double> featMap) {
|
|
|
if (null == profile) {
|
|
|
return;
|