...
|
...
|
@@ -55,14 +55,14 @@ public class QueryUserPersionalFactorBean { |
|
|
UserPersonalFactorRspNew userFactor = userComponent.queryUserPersionalFactor(userRecallRequest.getUid(), userRecallRequest.getUdid(), pageFactor.getMisortIds());
|
|
|
cost = System.currentTimeMillis() - begin;
|
|
|
|
|
|
if(userRecallRequest.openDetailLog()){
|
|
|
if (userRecallRequest.openDetailLog()) {
|
|
|
StringBuilder sizeLogInfo = new StringBuilder();
|
|
|
sizeLogInfo.append("SKN_SIZE is ").append(userFactor.getRecommendSknList().size()).append(";");
|
|
|
sizeLogInfo.append("RT_SB_SIZE is ").append(userFactor.getRealTimeSortBrandList().size()).append(";");
|
|
|
sizeLogInfo.append("VECTOR_RNN_SIZE is ").append(userFactor.getBrandVector().size()).append("_").append(userFactor.getSortBrandVector().size()).append(";");
|
|
|
sizeLogInfo.append("VECTOR_W2C_SIZE is ").append(userFactor.getBrandVectorW2v().size()).append("_").append(userFactor.getSortBrandVectorW2v().size()).append(";");
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactorBean[2]:queryUserPersionalFactor. uid is[{}],udid is[{}], cost is[{}], size log info is [{}] ", uid, udid, cost, sizeLogInfo.toString());
|
|
|
}else{
|
|
|
} else {
|
|
|
RECALL_NEW_LOGGER.info("QueryUserPersionalFactorBean[2]:queryUserPersionalFactor. uid is[{}],udid is[{}], cost is[{}]", uid, udid, cost);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -83,6 +83,7 @@ public class QueryUserPersionalFactorBean { |
|
|
List<SortPriceAreas> sortPriceAreasList = this.getSortPriceAreasListWithSort(userFactor, pageFactor);
|
|
|
//2、构造推荐的skn列表
|
|
|
List<Integer> recommendSknList = userFactor.getRecommendSknList();
|
|
|
List<Integer> realTimeSimilarSknList = userFactor.getRealTimeSimilarSknList();
|
|
|
|
|
|
//3、获取页面中存在的所有的key
|
|
|
Set<String> pageSortBrandKeys = new HashSet<>();
|
...
|
...
|
@@ -97,19 +98,20 @@ public class QueryUserPersionalFactorBean { |
|
|
filterSortBrandKeys.add(existSortBrand.key());
|
|
|
}
|
|
|
//5、构造基于RNN向量的【品牌+品牌】,去除实时的品类和品牌
|
|
|
int maxVectorRNNSortBrandCount = RecallCommonConstants.maxVectorRNNSortBrandCount;
|
|
|
List<SortBrand> vectorRnnSortBrandList = sortBrandVectorComponent.queryVectorSortBrandList(pageFactor, filterSortBrandKeys, userFactor.getBrandVector(), userFactor.getSortBrandVector(),true, maxVectorRNNSortBrandCount);
|
|
|
for (SortBrand existSortBrand : vectorRnnSortBrandList) {
|
|
|
filterSortBrandKeys.add(existSortBrand.key());
|
|
|
}
|
|
|
List<SortBrand> vectorRnnSortBrandList = new ArrayList<>();
|
|
|
// int maxVectorRNNSortBrandCount = RecallCommonConstants.maxVectorRNNSortBrandCount;
|
|
|
// List<SortBrand> vectorRnnSortBrandList = sortBrandVectorComponent.queryVectorSortBrandList(pageFactor, filterSortBrandKeys, userFactor.getBrandVector(), userFactor.getSortBrandVector(),true, maxVectorRNNSortBrandCount);
|
|
|
// for (SortBrand existSortBrand : vectorRnnSortBrandList) {
|
|
|
// filterSortBrandKeys.add(existSortBrand.key());
|
|
|
// }
|
|
|
//6、构造基于W2V向量的【品牌+品牌】,去除实时的品类和品牌
|
|
|
int maxVectorW2SortBrandCount = RecallCommonConstants.maxVectorW2SortBrandCount;
|
|
|
List<SortBrand> vectorW2vSortBrandList = sortBrandVectorComponent.queryVectorSortBrandList(pageFactor, filterSortBrandKeys, userFactor.getBrandVectorW2v(), userFactor.getSortBrandVectorW2v(),false, maxVectorW2SortBrandCount);
|
|
|
List<SortBrand> vectorW2vSortBrandList = sortBrandVectorComponent.queryVectorSortBrandList(pageFactor, filterSortBrandKeys, userFactor.getBrandVectorW2v(), userFactor.getSortBrandVectorW2v(), false, maxVectorW2SortBrandCount);
|
|
|
for (SortBrand existSortBrand : vectorW2vSortBrandList) {
|
|
|
filterSortBrandKeys.add(existSortBrand.key());
|
|
|
}
|
|
|
//8、返回最终结果
|
|
|
return new UserPersonalFactor(recommendSknList, sortPriceAreasList, realTimeSortBrandList, vectorRnnSortBrandList, vectorW2vSortBrandList);
|
|
|
//7、返回最终结果
|
|
|
return new UserPersonalFactor(recommendSknList, realTimeSimilarSknList, sortPriceAreasList, realTimeSortBrandList, vectorRnnSortBrandList, vectorW2vSortBrandList);
|
|
|
}
|
|
|
|
|
|
private List<SortBrand> getSortBrandListWithSort(Set<String> pageSortBrandKeys, Set<String> filterSortBrandKeys, List<SortBrand> userSortBrands, int maxCount) {
|
...
|
...
|
|