|
@@ -43,6 +43,9 @@ public class RankStrategyBy680 extends RankStrategyBasic {
|
|
|
@Value("${word2vec.exp:694}")
|
|
|
private String word2vecExp;
|
|
|
|
|
|
+ @Value("${swap.exp:770}")
|
|
|
+ protected String excludeExp;
|
|
|
+
|
|
|
@ApolloJsonValue("${rank.score.weight.680:{}}")
|
|
|
private Map<String, Double> weightMap;
|
|
|
|
|
@@ -85,6 +88,31 @@ public class RankStrategyBy680 extends RankStrategyBasic {
|
|
|
|
|
|
Map<String, String> userFeatureMap = new HashMap<>();
|
|
|
Map<String, String> c1Feature = userFeature.getOrDefault("alg_mid_feature_ad_action", new HashMap<>());
|
|
|
+ //用户历史是否有转化
|
|
|
+ boolean targetCrowd = false;
|
|
|
+ if (c1Feature.containsKey("user_conver_ad_class") && StringUtils.isNotEmpty(c1Feature.get("user_conver_ad_class"))
|
|
|
+ && c1Feature.get("user_conver_ad_class").contains("中医")) {
|
|
|
+ targetCrowd = true;
|
|
|
+ } else {
|
|
|
+ if (c1Feature.containsKey("user_conver_ad_class_history_delta")
|
|
|
+ && StringUtils.isNotEmpty(c1Feature.get("user_conver_ad_class_history_delta"))
|
|
|
+ && c1Feature.get("user_conver_ad_class_history_delta").contains("中医")) {
|
|
|
+ targetCrowd = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //满足试验条件&&特定人群
|
|
|
+ if (scoreParam.getExpCodeSet().contains(excludeExp) && targetCrowd) {
|
|
|
+ List<AdPlatformCreativeDTO> adIdList = request.getAdIdList();
|
|
|
+ Set<String> professions = adIdList.stream().map(AdPlatformCreativeDTO::getProfession).collect(Collectors.toSet());
|
|
|
+ //同时存在中医行业和兴趣教育行业
|
|
|
+ if (professions.contains("中医") && professions.contains("兴趣教育")) {
|
|
|
+ List<AdPlatformCreativeDTO> filteredAdList = adIdList.stream()
|
|
|
+ .filter(e -> !Objects.equals(e.getProfession(), "兴趣教育")).collect(Collectors.toList());
|
|
|
+ request.setAdIdList(filteredAdList);
|
|
|
+ }
|
|
|
+ log.info("excludeExp filtered request={}", request);
|
|
|
+ }
|
|
|
+
|
|
|
List<TupleMapEntry<Tuple5>> midActionList = this.handleC1Feature(c1Feature, userFeatureMap);
|
|
|
|
|
|
Map<String, Double> midTimeDiffMap = this.parseC1FeatureListToTimeDiffMap(midActionList, ts);
|