|
|
|
@ -144,12 +144,12 @@ public class VecTest {
|
|
|
|
|
if (count > 1) {
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("sourceId", library.getId());
|
|
|
|
|
map.put("sourceDesc", library.getDescription());
|
|
|
|
|
map.put("sourceDesc", library.getStandardQuestion());
|
|
|
|
|
map.put("sourceQuestion", sourceQuestion);
|
|
|
|
|
map.put("sourceQuestionCode", library.getCode());
|
|
|
|
|
map.put("sourceDicPath", dicMap.get(library.getDictId()).getNameZhPath());
|
|
|
|
|
map.put("targetId", library.getId());
|
|
|
|
|
map.put("targetDesc", library.getDescription());
|
|
|
|
|
map.put("targetDesc", library.getStandardQuestion());
|
|
|
|
|
map.put("targetQuestion", sourceQuestion);
|
|
|
|
|
map.put("sameSource", "是");
|
|
|
|
|
map.put("targetDicPath", dicMap.get(library.getDictId()).getNameZhPath());
|
|
|
|
@ -168,11 +168,11 @@ public class VecTest {
|
|
|
|
|
if (StrUtil.equals(sourceQuestion, targetQuestion)) {
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("sourceId", library.getId());
|
|
|
|
|
map.put("sourceDesc", library.getDescription());
|
|
|
|
|
map.put("sourceDesc", library.getStandardQuestion());
|
|
|
|
|
map.put("sourceQuestion", sourceQuestion);
|
|
|
|
|
map.put("sourceDicPath", dicMap.get(library.getDictId()).getNameZhPath());
|
|
|
|
|
map.put("targetId", targetLibrary.getId());
|
|
|
|
|
map.put("targetDesc", targetLibrary.getDescription());
|
|
|
|
|
map.put("targetDesc", targetLibrary.getStandardQuestion());
|
|
|
|
|
map.put("targetQuestion", targetQuestion);
|
|
|
|
|
// 如果id相等则是同源数据
|
|
|
|
|
map.put("sameSource", "否");
|
|
|
|
@ -225,13 +225,13 @@ public class VecTest {
|
|
|
|
|
if (!StrUtil.equals(questionLibrary.getId(), targetId)) {
|
|
|
|
|
HashMap<String, Object> map1 = new HashMap<>();
|
|
|
|
|
map1.put("sourceId", questionLibrary.getId());
|
|
|
|
|
map1.put("sourceDesc", questionLibrary.getDescription());
|
|
|
|
|
map1.put("sourceDesc", questionLibrary.getStandardQuestion());
|
|
|
|
|
map1.put("sourceQuestion", question);
|
|
|
|
|
CommonDic commonDic = dicMap.get(questionLibrary.getDictId());
|
|
|
|
|
map1.put("sourceDicPath", commonDic.getNameZhPath());
|
|
|
|
|
map1.put("targetId", targetId);
|
|
|
|
|
AskTemplateQuestionLibrary targetLibrary = libraryMap.get(targetId);
|
|
|
|
|
map1.put("targetDesc", targetLibrary.getDescription());
|
|
|
|
|
map1.put("targetDesc", targetLibrary.getStandardQuestion());
|
|
|
|
|
map1.put("targetQuestion", MapUtil.getStr(map, "matchQuestion"));
|
|
|
|
|
map1.put("matchScore", MapUtil.getStr(map, "matchScore"));
|
|
|
|
|
map1.put("targetDicPath", dicMap.get(targetLibrary.getDictId()).getNameZhPath());
|
|
|
|
@ -288,14 +288,14 @@ public class VecTest {
|
|
|
|
|
String matchQuestion = MapUtil.getStr(matchMap, "matchQuestion");
|
|
|
|
|
String matchScore = MapUtil.getStr(matchMap, "matchScore");
|
|
|
|
|
map.put("sourceId", questionLibrary.getId());
|
|
|
|
|
map.put("sourceDesc", questionLibrary.getDescription());
|
|
|
|
|
map.put("sourceDesc", questionLibrary.getStandardQuestion());
|
|
|
|
|
map.put("sourceQuestion", question);
|
|
|
|
|
String sourceNamePath = dicMap.get(questionLibrary.getDictId()).getNameZhPath();
|
|
|
|
|
map.put("sourceDicPath", sourceNamePath);
|
|
|
|
|
|
|
|
|
|
map.put("targetId", targetId);
|
|
|
|
|
AskTemplateQuestionLibrary targetLibrary = libraryMap.get(targetId);
|
|
|
|
|
map.put("targetDesc", targetLibrary.getDescription());
|
|
|
|
|
map.put("targetDesc", targetLibrary.getStandardQuestion());
|
|
|
|
|
map.put("targetQuestion", matchQuestion);
|
|
|
|
|
String targetNamePath = dicMap.get(targetLibrary.getDictId()).getNameZhPath();
|
|
|
|
|
map.put("targetDicPath", targetNamePath);
|
|
|
|
@ -359,7 +359,7 @@ public class VecTest {
|
|
|
|
|
map.put("targetId", targetId);
|
|
|
|
|
map.put("targetQuestion", matchQuestion);
|
|
|
|
|
AskTemplateQuestionLibrary targetLibrary = libraryMap.get(targetId);
|
|
|
|
|
map.put("targetDesc", targetLibrary.getDescription());
|
|
|
|
|
map.put("targetDesc", targetLibrary.getStandardQuestion());
|
|
|
|
|
Long dictId = targetLibrary.getDictId();
|
|
|
|
|
map.put("targetDicPath", dicMap.get(dictId).getNameZhPath());
|
|
|
|
|
map.put("matchScore", score);
|
|
|
|
@ -430,7 +430,7 @@ public class VecTest {
|
|
|
|
|
List<Map<String, Object>> vecData = questionLibraries.stream().map(library -> {
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("questionCode", library.getId());
|
|
|
|
|
map.put("questionList", CollUtil.newArrayList(library.getDescription()));
|
|
|
|
|
map.put("questionList", CollUtil.newArrayList(library.getStandardQuestion()));
|
|
|
|
|
return map;
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
saveVec(vecData);
|
|
|
|
@ -468,7 +468,7 @@ public class VecTest {
|
|
|
|
|
|
|
|
|
|
AskPatientAnswer askPatientAnswer = answerMap.get(questionLibrary.getId());
|
|
|
|
|
if (ObjectUtil.isEmpty(askPatientAnswer)) {
|
|
|
|
|
log.info("问题:id:{} desc:{},未设置回复答案,跳过", questionLibrary.getId(), questionLibrary.getDescription());
|
|
|
|
|
log.info("问题:id:{} desc:{},未设置回复答案,跳过", questionLibrary.getId(), questionLibrary.getStandardQuestion());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
@ -541,7 +541,7 @@ public class VecTest {
|
|
|
|
|
List<Map<String, Object>> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (AskTemplateQuestionLibrary questionLibrary : questionLibraries) {
|
|
|
|
|
String description = questionLibrary.getDescription();
|
|
|
|
|
String description = questionLibrary.getStandardQuestion();
|
|
|
|
|
List<Map<String, Object>> maps = questionMatch(description);
|
|
|
|
|
// 只获取前四条数据
|
|
|
|
|
if (CollUtil.isEmpty(maps)) {
|
|
|
|
@ -607,7 +607,7 @@ public class VecTest {
|
|
|
|
|
|
|
|
|
|
AskPatientAnswer askPatientAnswer = answerMap.get(questionLibrary.getId());
|
|
|
|
|
if (ObjectUtil.isEmpty(askPatientAnswer)) {
|
|
|
|
|
log.info("问题:id:{} desc:{},未设置回复答案,跳过", questionLibrary.getId(), questionLibrary.getDescription());
|
|
|
|
|
log.info("问题:id:{} desc:{},未设置回复答案,跳过", questionLibrary.getId(), questionLibrary.getStandardQuestion());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
for (String question : similarQuestionMap.get(questionLibrary.getId())) {
|
|
|
|
@ -632,7 +632,7 @@ public class VecTest {
|
|
|
|
|
Map<String, List<String>> similarQuestionMap = askTemplateQuestionSimilarityService.querySimilarityQuestionMapByLibraryLists(questionLibraries);
|
|
|
|
|
Console console = System.console();
|
|
|
|
|
for (AskTemplateQuestionLibrary questionLibrary : questionLibraries) {
|
|
|
|
|
String description = questionLibrary.getDescription();
|
|
|
|
|
String description = questionLibrary.getStandardQuestion();
|
|
|
|
|
List<String> question = similarQuestionMap.get(questionLibrary.getId());
|
|
|
|
|
|
|
|
|
|
List<String> addList = new ArrayList<>();
|
|
|
|
@ -676,7 +676,7 @@ public class VecTest {
|
|
|
|
|
map.put("targetId", targetId);
|
|
|
|
|
map.put("targetQuestion", matchQuestion);
|
|
|
|
|
AskTemplateQuestionLibrary targetLibrary = libraryMap.get(targetId);
|
|
|
|
|
map.put("targetDesc", targetLibrary.getDescription());
|
|
|
|
|
map.put("targetDesc", targetLibrary.getStandardQuestion());
|
|
|
|
|
Long dictId = targetLibrary.getDictId();
|
|
|
|
|
map.put("targetDicPath", dicMap.get(dictId).getNameZhPath());
|
|
|
|
|
map.put("matchScore", score);
|
|
|
|
|