|
|
@@ -54,7 +54,8 @@ public class YearReturnCate2RecallStrategy implements RecallStrategy {
|
|
|
if (CollectionUtils.isEmpty(userNetworkVideoCate2)) {
|
|
|
return videosResult;
|
|
|
}
|
|
|
- List<String> lastTopNCate = userNetworkVideoCate2.subList(0, 3).stream()
|
|
|
+ int limit = Math.min(userNetworkVideoCate2.size(), 3);
|
|
|
+ List<String> lastTopNCate = userNetworkVideoCate2.subList(0, limit).stream()
|
|
|
.map(Pair::getValue)
|
|
|
.distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
@@ -64,7 +65,7 @@ public class YearReturnCate2RecallStrategy implements RecallStrategy {
|
|
|
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet()
|
|
|
.stream()
|
|
|
.sorted(Map.Entry.<String, Long>comparingByValue().reversed())
|
|
|
- .limit(3)
|
|
|
+ .limit(limit)
|
|
|
.map(Map.Entry::getKey)
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
@@ -97,7 +98,7 @@ public class YearReturnCate2RecallStrategy implements RecallStrategy {
|
|
|
for (int i = 0; i < actVidSeq.size(); i++) {
|
|
|
long videoIdL = Long.parseLong(actVidSeq.get(i));
|
|
|
String type = actTypeSeq.get(i);
|
|
|
- if (!"share".equals(type)) {
|
|
|
+ if (!"click".equals(type)) {
|
|
|
continue;
|
|
|
}
|
|
|
|