|
@@ -1,9 +1,7 @@
|
|
|
package com.tzld.piaoquan.recommend.server.service.score.model;
|
|
package com.tzld.piaoquan.recommend.server.service.score.model;
|
|
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.aliyun.openservices.eas.predict.http.HttpConfig;
|
|
import com.aliyun.openservices.eas.predict.http.HttpConfig;
|
|
|
import com.aliyun.openservices.eas.predict.http.PredictClient;
|
|
import com.aliyun.openservices.eas.predict.http.PredictClient;
|
|
|
-import com.aliyun.openservices.eas.predict.proto.PredictProtos;
|
|
|
|
|
import com.aliyun.openservices.eas.predict.request.TFDataType;
|
|
import com.aliyun.openservices.eas.predict.request.TFDataType;
|
|
|
import com.aliyun.openservices.eas.predict.request.TFRequest;
|
|
import com.aliyun.openservices.eas.predict.request.TFRequest;
|
|
|
import com.aliyun.openservices.eas.predict.response.TFResponse;
|
|
import com.aliyun.openservices.eas.predict.response.TFResponse;
|
|
@@ -103,8 +101,8 @@ public class PAIModel {
|
|
|
for (int i = 0; i < size; i++) {
|
|
for (int i = 0; i < size; i++) {
|
|
|
Map<String, String> featureMapString = featureMapStringList.get(i);
|
|
Map<String, String> featureMapString = featureMapStringList.get(i);
|
|
|
String[] strArr = stringFeatureArr.computeIfAbsent(featureName, s -> new String[size]);
|
|
String[] strArr = stringFeatureArr.computeIfAbsent(featureName, s -> new String[size]);
|
|
|
- String value = featureMapString.getOrDefault(featureKey, defaultValue);
|
|
|
|
|
- strArr[i] = value;
|
|
|
|
|
|
|
+ String value = featureMapString.get(featureKey);
|
|
|
|
|
+ strArr[i] = Objects.nonNull(value) ? value : defaultValue;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
for (int i = 0; i < size; i++) {
|
|
for (int i = 0; i < size; i++) {
|