Browse Source

Merge branch 'feature_20240705_zhaohaipeng_model_v2' of algorithm/ad-engine into master

zhaohaipeng 9 months ago
parent
commit
cae7678d83

+ 8 - 2
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/log/impl/LogHubServiceImpl.java

@@ -72,6 +72,7 @@ public class LogHubServiceImpl implements LogHubService {
                     JSONObject json = new JSONObject();
                     json.put("cid", rankItem.getAdId());
                     json.put("score", rankItem.getScore());
+                    rankItem.getScoreMap().put("score", rankItem.getScore());
                     json.put("scoremap", rankItem.getScoreMap());
                     JSONObject featureJson = new JSONObject();
                     for (Map.Entry<String, String> entry : rankItem.getFeatureMap().entrySet()) {
@@ -84,8 +85,9 @@ public class LogHubServiceImpl implements LogHubService {
                             featureJson.put(entry.getKey(), entry.getValue());
                         }
                     }
+
                     if (MapUtils.isNotEmpty(featureJson)) {
-                        json.put("feature", featureJson);
+                        json.put("allfeature", featureJson);
                     }
                     scoreResult.add(json);
                 }
@@ -100,9 +102,13 @@ public class LogHubServiceImpl implements LogHubService {
                 logMap.put("adid", top1.getId());
                 logMap.put("campaignid", top1.getCampaignId());
                 logMap.put("score", top1.getScore());
+
+
+                top1.getScoreMap().put("score", top1.getScore());
+                logMap.put("scoremap", JSON.toJSONString(top1.getScoreMap()));
                 logMap.put("allfeature", JSON.toJSONString(top1.getFeatureMap()));
                 logMap.put("metafeature", JSON.toJSONString(top1.getMetaFeatureMap()));
-                logMap.put("scoremap", JSON.toJSONString(top1.getScoreMap()));
+
 
                 // logMap.put("scorestrategy", scoreStrategy);
                 // logMap.put("creativeList", JSON.toJSONString(adIdList));