|
|
package com.yoho.search.service.recall.models.personal;
|
|
|
|
|
|
import com.yoho.search.core.personalized.models.PersonalizedSearch;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
...
|
...
|
@@ -17,7 +18,13 @@ public class UserFeatureFactor { |
|
|
}
|
|
|
this.vectorFeatureVersion = personalizedSearch.getVectorFeatureVersion();
|
|
|
String userVectorFeature = personalizedSearch.getUserVectorFeature();
|
|
|
if(StringUtils.isBlank(userVectorFeature)){
|
|
|
return;
|
|
|
}
|
|
|
String[] userFeatureFactorStrArr = userVectorFeature.split(",");
|
|
|
if(userFeatureFactorStrArr.length==0){
|
|
|
return;
|
|
|
}
|
|
|
userFeatureVectorList = new ArrayList<>(userFeatureFactorStrArr.length);
|
|
|
for (String userFeatureFactorStr : userFeatureFactorStrArr) {
|
|
|
double userFeatureVector = Double.parseDouble(userFeatureFactorStr.trim());
|
...
|
...
|
|