|
|
|
@ -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;
|
|
|
|
|