|
|
@@ -21,7 +21,7 @@ import java.util.stream.Collectors;
|
|
|
@Component
|
|
|
public class VideoAttrWeightRerankStrategy extends BasicRerankStrategy {
|
|
|
|
|
|
- @ApolloJsonValue("${video.attr.rerank.config:[]}")
|
|
|
+ @ApolloJsonValue("${video.attr.weight.rerank.config:[]}")
|
|
|
private List<VideoAttributeConfigItem> configItems;
|
|
|
|
|
|
@Override
|
|
|
@@ -46,7 +46,6 @@ public class VideoAttrWeightRerankStrategy extends BasicRerankStrategy {
|
|
|
double score = video.getScore();
|
|
|
video.getScoresMap().put("rerankBeforeScore", score);
|
|
|
|
|
|
- double newScore = score;
|
|
|
Map<String, String> basicInfo = video.getMetaFeatureMap().getOrDefault("alg_vid_feature_basic_info", new HashMap<>());
|
|
|
|
|
|
for (VideoAttributeConfigItem configItem : configItems) {
|
|
|
@@ -75,14 +74,14 @@ public class VideoAttrWeightRerankStrategy extends BasicRerankStrategy {
|
|
|
|
|
|
double weight = configItem.getWeight();
|
|
|
|
|
|
- newScore = newScore * weight;
|
|
|
+ score *= weight;
|
|
|
video.getScoresMap().put(String.format("%s_%s_%s", key, value, time), weight);
|
|
|
|
|
|
}
|
|
|
|
|
|
video.getScoresMap().put("rerankAfterScore", score);
|
|
|
- video.setScore(newScore);
|
|
|
- video.setSortScore(newScore);
|
|
|
+ video.setScore(score);
|
|
|
+ video.setSortScore(score);
|
|
|
}
|
|
|
|
|
|
@Data
|