rasa: text2vecData 修复

dev_2.1.0
xueqingkun 1 year ago
parent e7f19e5105
commit 81e7c4fd57

@ -86,9 +86,11 @@ public class Text2vecServiceImpl implements Text2vecService {
Map<String, QuestionAnswerDTO> intentCodeAndIdMap = rasaCmdService.getIntentCodeAndIdMap();
// 更新text2vec数据信息
List<Text2vecDataVo> text2vecDataVoList = intentCodeAndIdMap.entrySet().stream()
.filter(entry -> Objects.nonNull(entry.getValue()) && CollUtil.isNotEmpty(entry.getValue().getQuestionList()))
.filter(entry -> Objects.nonNull(entry.getValue())
&& CollUtil.isNotEmpty(entry.getValue().getQuestionList())
&& CollUtil.isNotEmpty(entry.getValue().getAnswerList()))
.flatMap(entry -> entry.getValue().getQuestionList().stream()
.map(question -> new Text2vecDataVo(entry.getKey(), question))).collect(Collectors.toList());
.map(question -> new Text2vecDataVo(entry.getValue().getAnswerList().get(0), question))).collect(Collectors.toList());
if (CollUtil.isEmpty(text2vecDataVoList)){
log.info("text2vec数据初始化失败text2vec数据为空....");
return;

@ -219,8 +219,11 @@ public class RasaCmdServiceImpl implements RasaCmdService {
// 更新text2vec数据信息
List<Text2vecDataVo> text2vecDataVoList = questionAnswerDTOMap.entrySet().stream()
.filter(entry -> Objects.nonNull(entry.getValue())
&& CollUtil.isNotEmpty(entry.getValue().getQuestionList())
&& CollUtil.isNotEmpty(entry.getValue().getAnswerList()))
.flatMap(entry -> entry.getValue().getQuestionList().stream()
.map(question -> new Text2vecDataVo(entry.getKey(), question))).collect(Collectors.toList());
.map(question -> new Text2vecDataVo(entry.getValue().getAnswerList().get(0), question))).collect(Collectors.toList());
text2vecService.updateDataset(text2vecDataVoList);
return true;

Loading…
Cancel
Save