Commit c5904d86 by shenjunjie

Merge branch 'release' into 'master'

Release

See merge request !587
parents 83fda0cb fd55f1af
......@@ -4076,7 +4076,7 @@ public class MarkDataServiceImpl implements MarkDataService {
project.getContendList().forEach(contend -> brandStr.append("、").append(contend.getBrandName()));
}
questionPair = standardRequest(question, modelName, MessageFormat.format(QUESTION_PROMPT, brandStr));
if (Objects.isNull(questionPair)) {
if (Objects.isNull(questionPair) || Objects.equals("无法回答", questionPair.getLeft())) {
return null;
}
JSONObject json = JSON.parseObject(questionPair.getLeft());
......
......@@ -561,7 +561,7 @@ public class ToolsetServiceImpl implements ToolsetService {
List<BytedanceCustomEventUpdateTaskData> data = entry.getValue();
BytedanceCustomEventUpdateTask.EventInfo eventInfo = new BytedanceCustomEventUpdateTask.EventInfo();
eventInfo.setName(eventName);
eventInfo.setDataCount(data.size());
eventInfo.setDataCount(Math.max(data.size(), 1));
// 计算影响力指数
eventInfo.setInfluence(computeInf(data, levelInfoMap));
eventInfoMap.put(eventName, eventInfo);
......@@ -717,7 +717,7 @@ public class ToolsetServiceImpl implements ToolsetService {
private Double computeInf(List<BytedanceCustomEventUpdateTaskData> datas, Map<String, BytedanceCustomChannelLevelInfo> levelInfoMap){
Map<String, Double> levelSumH = new HashMap<>(5);
if (CollectionUtils.isEmpty(datas)){
return 0d;
return 1d;
}
for (BytedanceCustomEventUpdateTaskData data : datas) {
// 匹配渠道影响力,微博、微信以外的平台一律按照”网媒“处理
......@@ -757,7 +757,8 @@ public class ToolsetServiceImpl implements ToolsetService {
// 3.各自乘以权重 结果相加
result = INF.multiply(BigDecimal.valueOf(levelInfo.getWeight())).add(BigDecimal.valueOf(result)).doubleValue();
}
return BigDecimal.valueOf(result).setScale(1, RoundingMode.HALF_UP).doubleValue();
double resVal = BigDecimal.valueOf(result).setScale(1, RoundingMode.HALF_UP).doubleValue();
return resVal > 1 ? resVal : 1d;
}
private double getMatchedDefaultChannelInf(String level){
......@@ -781,6 +782,9 @@ public class ToolsetServiceImpl implements ToolsetService {
* @return
*/
private Double computeRMI(List<BytedanceCustomEventUpdateTaskData> data){
if (CollectionUtils.isEmpty(data)){
return 1d;
}
// 1、初始值
// 微信文章数
int wechatArticle = (int) data.stream().filter(article -> Objects.equals("微信", article.getPlatformType())).count();
......@@ -875,7 +879,7 @@ public class ToolsetServiceImpl implements ToolsetService {
// 头条互动数:TI标= ln(TI+1)/ln(TI常+1)*100.0
BigDecimal TI = BigDecimal.valueOf(Math.log(toutiaoInteraction + 1)).divide(BigDecimal.valueOf(Math.log(toutiaoInteractionWeight.getConstant() + 1)), 20, RoundingMode.HALF_UP).multiply(bigDecimal100);
// 标准值与权重计算取和得RMI
return NM.multiply(BigDecimal.valueOf(normalMediaArticleWeight.getWeight()))
double resVal = NM.multiply(BigDecimal.valueOf(normalMediaArticleWeight.getWeight()))
.add(OM.multiply(BigDecimal.valueOf(otherPlatformArticleWeight.getWeight())))
.add(WC.multiply(BigDecimal.valueOf(wechatArticleWeight.getWeight())))
.add(WCR.multiply(BigDecimal.valueOf(wechatReadWeight.getWeight())))
......@@ -887,6 +891,7 @@ public class ToolsetServiceImpl implements ToolsetService {
.add(TI.multiply(BigDecimal.valueOf(toutiaoInteractionWeight.getWeight())))
.setScale(1, RoundingMode.HALF_UP)
.doubleValue();
return resVal > 1 ? resVal : 1d;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment