Browse Source

模型实验

zhangbo 1 year ago
parent
commit
7a8d0b037a

+ 2 - 3
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/rank/strategy/RankStrategy4RankModel.java

@@ -17,7 +17,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.connection.RedisConnectionFactory;
 import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
 import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
-import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 
@@ -96,6 +96,7 @@ public class RankStrategy4RankModel extends RankService {
         RedisConnectionFactory connectionFactory = new JedisConnectionFactory(redisSC);
         RedisTemplate<String, String> redisTemplate = new RedisTemplate<>();
         redisTemplate.setConnectionFactory(connectionFactory);
+        redisTemplate.setDefaultSerializer(new StringRedisSerializer());
         redisTemplate.afterPropertiesSet();
 
         Map<String, String> userFeatureMap = new HashMap<>();
@@ -170,8 +171,6 @@ public class RankStrategy4RankModel extends RankService {
         }
         log.info("ItemFeature = {}", JSONUtils.toJson(videoFeatures));
 
-        ((JedisConnectionFactory) connectionFactory).destroy();
-
         Map<String, String> sceneFeatureMap =  this.getSceneFeature(param);
 
         List<RankItem> rovRecallScore = ScorerUtils.getScorerPipeline(ScorerUtils.BASE_CONF)

+ 1 - 1
recommend-server-service/src/main/resources/feeds_score_config_baseline.conf

@@ -2,6 +2,6 @@ scorer-config = {
   related-score-config = {
     scorer-name = "com.tzld.piaoquan.recommend.server.service.score.VlogShareLRScorer"
     scorer-priority = 99
-    model-path = "model/model_sharev2_20231220.txt"
+    model-path = "video_str_model/model_sharev2_20231220_change.txt"
   }
 }