原子指标判断代码提交

topo_dev
liu 10 months ago
parent f8ed976a06
commit 34dfc0bfc7

@ -127,10 +127,14 @@ public class ModelRecordTypeServiceImpl extends ServiceImpl<ModelRecordTypeMappe
} }
private List<TripleInfo> extractTripleInfo(String caseId, String name, String recordId) { private List<TripleInfo> extractTripleInfo(String caseId, String name, String recordId) {
List<NoteRecordSplit> records = noteRecordSplitMapper.selectRecord(caseId, name, recordId); // 首先获取所有切分后的笔录
List<NoteRecordSplit> recordSplitList= noteRecordSplitMapper.selectRecord(caseId, name, recordId);
List<TripleInfo> tripleInfos = new ArrayList<>(); List<TripleInfo> tripleInfos = new ArrayList<>();
for (NoteRecordSplit record : records) { // 对切分后的笔录进行遍历
for (NoteRecordSplit record : recordSplitList) {
// 根据笔录类型找到所有的提取三元组的提示词
List<NotePrompt> prompts = notePromptMapper.queryPrompt(record.getRecordTypeId()); List<NotePrompt> prompts = notePromptMapper.queryPrompt(record.getRecordTypeId());
// 遍历提示词进行提取
for (NotePrompt prompt : prompts) { for (NotePrompt prompt : prompts) {
if (StringUtils.isEmpty(prompt.getPrompt())) { if (StringUtils.isEmpty(prompt.getPrompt())) {
continue; continue;
@ -146,6 +150,7 @@ public class ModelRecordTypeServiceImpl extends ServiceImpl<ModelRecordTypeMappe
log.info("耗时:{}", stopWatch.getTotalTimeSeconds()); log.info("耗时:{}", stopWatch.getTotalTimeSeconds());
String content = call.getResult().getOutput().getContent(); String content = call.getResult().getOutput().getContent();
log.info("分析的结果是:{}", content); log.info("分析的结果是:{}", content);
// 获取从提示词中提取到的三元组信息
JSONObject jsonObject = new JSONObject(content); JSONObject jsonObject = new JSONObject(content);
JSONArray threeInfo = jsonObject.getJSONArray("result"); JSONArray threeInfo = jsonObject.getJSONArray("result");
for (int i = 0; i < threeInfo.length(); i++) { for (int i = 0; i < threeInfo.length(); i++) {
@ -159,6 +164,7 @@ public class ModelRecordTypeServiceImpl extends ServiceImpl<ModelRecordTypeMappe
if (StrUtil.hasEmpty(startNodeType, entity, endNodeType, property, value)) { if (StrUtil.hasEmpty(startNodeType, entity, endNodeType, property, value)) {
continue; continue;
} }
// 将三元组信息进行保存操作
TripleInfo tripleInfo = new TripleInfo(entity, property, value, record.getId(), LocalDateTime.now(), startNodeType, endNodeType); TripleInfo tripleInfo = new TripleInfo(entity, property, value, record.getId(), LocalDateTime.now(), startNodeType, endNodeType);
tripleInfoMapper.insert(tripleInfo); tripleInfoMapper.insert(tripleInfo);
tripleInfos.add(tripleInfo); tripleInfos.add(tripleInfo);

@ -67,7 +67,7 @@ public class ModelServiceImpl implements ModelService {
//原子指标结果表 //原子指标结果表
try { try {
// index_source==1 // index_source==1
List<ModelAtomicIndex> list = analyseCaseDTO.getAtomicIndexList(); // List<ModelAtomicIndex> list = analyseCaseDTO.getAtomicIndexList();
//index_source==3 //index_source==3
//查询图谱 index_source: 1人工定义 2数据库查询 3图谱生成 4大模型 //查询图谱 index_source: 1人工定义 2数据库查询 3图谱生成 4大模型

Loading…
Cancel
Save