|
@@ -184,10 +184,11 @@ public class VlogShareLRScorer4Ros extends BaseLRModelScorer {
|
|
}
|
|
}
|
|
LOGGER.debug("Ctr Score {}, Total: {}, Cancel: {}", requestContext.getRequest_id(), items.size(), cancel);
|
|
LOGGER.debug("Ctr Score {}, Total: {}, Cancel: {}", requestContext.getRequest_id(), items.size(), cancel);
|
|
}
|
|
}
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<RankItem> scoring(final Map<String, String> sceneFeatureMap,
|
|
public List<RankItem> scoring(final Map<String, String> sceneFeatureMap,
|
|
final Map<String, String> userFeatureMap,
|
|
final Map<String, String> userFeatureMap,
|
|
- final List<RankItem> rankItems){
|
|
|
|
|
|
+ final List<RankItem> rankItems) {
|
|
if (CollectionUtils.isEmpty(rankItems)) {
|
|
if (CollectionUtils.isEmpty(rankItems)) {
|
|
return rankItems;
|
|
return rankItems;
|
|
}
|
|
}
|
|
@@ -215,12 +216,12 @@ public class VlogShareLRScorer4Ros extends BaseLRModelScorer {
|
|
LOGGER.debug("model size: [{}]", model.getModelSize());
|
|
LOGGER.debug("model size: [{}]", model.getModelSize());
|
|
// userBytes
|
|
// userBytes
|
|
Map<String, byte[]> userFeatureMapByte = new HashMap<>();
|
|
Map<String, byte[]> userFeatureMapByte = new HashMap<>();
|
|
- for(Map.Entry<String, String> entry: userFeatureMap.entrySet()){
|
|
|
|
|
|
+ for (Map.Entry<String, String> entry : userFeatureMap.entrySet()) {
|
|
userFeatureMapByte.put(entry.getKey(), entry.getValue().getBytes());
|
|
userFeatureMapByte.put(entry.getKey(), entry.getValue().getBytes());
|
|
}
|
|
}
|
|
//sceneBytes
|
|
//sceneBytes
|
|
Map<String, byte[]> sceneFeatureMapByte = new HashMap<>();
|
|
Map<String, byte[]> sceneFeatureMapByte = new HashMap<>();
|
|
- for(Map.Entry<String, String> entry: sceneFeatureMap.entrySet()){
|
|
|
|
|
|
+ for (Map.Entry<String, String> entry : sceneFeatureMap.entrySet()) {
|
|
sceneFeatureMapByte.put(entry.getKey(), entry.getValue().getBytes());
|
|
sceneFeatureMapByte.put(entry.getKey(), entry.getValue().getBytes());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -279,6 +280,9 @@ public class VlogShareLRScorer4Ros extends BaseLRModelScorer {
|
|
if (!future.isDone() || future.isCancelled() || future.get() == null) {
|
|
if (!future.isDone() || future.isCancelled() || future.get() == null) {
|
|
cancel++;
|
|
cancel++;
|
|
}
|
|
}
|
|
|
|
+ if (!future.isDone() && !future.isCancelled()) {
|
|
|
|
+ future.cancel(true);
|
|
|
|
+ }
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
LOGGER.error("InterruptedException {},{}", ExceptionUtils.getFullStackTrace(e));
|
|
LOGGER.error("InterruptedException {},{}", ExceptionUtils.getFullStackTrace(e));
|
|
} catch (ExecutionException e) {
|
|
} catch (ExecutionException e) {
|
|
@@ -302,7 +306,7 @@ public class VlogShareLRScorer4Ros extends BaseLRModelScorer {
|
|
try {
|
|
try {
|
|
|
|
|
|
Map<String, byte[]> itemFeatureByte = new HashMap<>();
|
|
Map<String, byte[]> itemFeatureByte = new HashMap<>();
|
|
- for (Map.Entry<String, String> entry: item.getFeatureMap().entrySet()){
|
|
|
|
|
|
+ for (Map.Entry<String, String> entry : item.getFeatureMap().entrySet()) {
|
|
itemFeatureByte.put(entry.getKey(), entry.getValue().getBytes());
|
|
itemFeatureByte.put(entry.getKey(), entry.getValue().getBytes());
|
|
}
|
|
}
|
|
lrSamples = bytesFeatureExtractor.single(userFeatureMapByte, itemFeatureByte, sceneFeatureMapByte);
|
|
lrSamples = bytesFeatureExtractor.single(userFeatureMapByte, itemFeatureByte, sceneFeatureMapByte);
|