master
周文涛 2 years ago
parent 7756c7117b
commit 2d65be3bc3

@ -942,6 +942,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
//用于数据结构化的对象
List<OcrResultDTO> ocrResultDTOList = new ArrayList<>();
Date startDataCheckTime = new Date();
Map<String, Boolean> fieldRightMap = new LinkedHashMap<>();//存放 字段判断正确map
for (OcrIdentifyDetail ocrIdentifyDetail : identifyDetailList) {
/*if (i1==1) {
ocrIdentifyDetail.setSemanticResult("{\"ocr_res\":[[[[1282.0,1576.0],[2764.0,1594.0],[2763.0,1671.0],[1281.0,1653.0]],[\"北京市朝阳区三里屯社区卫生服务中心\",0.9670220613479614]],[[[132.0,2244.0],[1062.0,2214.0],[1069.0,2455.0],[140.0,2485.0]],[\"儿科专家门诊\",0.984556257724762]],[[[117.0,2496.0],[1036.0,2473.0],[1038.0,2577.0],[119.0,2600.0]],[\"Pediatric srecialistclinic\",0.8756008148193359]]],\"其他\":[{\"area\":[[117.0,2496.0],[1036.0,2473.0],[1038.0,2577.0],[119.0,2600.0]],\"end\":26,\"ocrText\":\"Pediatric srecialistclinic\",\"probability\":0.9925054592526585,\"start\":0,\"text\":\"Pediatric srecialistclinic\"}],\"医院名称\":[{\"area\":[[1282.0,1576.0],[2764.0,1594.0],[2763.0,1671.0],[1281.0,1653.0]],\"end\":17,\"ocrText\":\"北京市朝阳区三里屯社区卫生服务中心\",\"probability\":0.9681764264135495,\"start\":0,\"text\":\"北京市朝阳区三里屯社区卫生服务中心\"},{\"area\":[[1282.0,1576.0],[2764.0,1594.0],[2763.0,1671.0],[1281.0,1653.0]],\"end\":17,\"ocrText\":\"北京市朝阳区农光里医院\",\"probability\":0.95,\"start\":0,\"text\":\"北京市朝阳区农光里医院\"}],\"姓名\":[],\"时间\":[],\"科室\":[{\"area\":[[132.0,2244.0],[1062.0,2214.0],[1069.0,2455.0],[140.0,2485.0]],\"end\":6,\"ocrText\":\"儿科专家门诊\",\"probability\":0.9836859327676066,\"start\":0,\"text\":\"儿科专家门诊\"}]}");
@ -973,7 +974,6 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
String text = null;//ocr 识别的文本
Double probability = 0d;
StringBuffer rMessage = new StringBuffer();
Map<String, Boolean> fieldRightMap = new LinkedHashMap<>();//存放 字段判断正确map
//==========================
checkSemanticFor: for (CheckSemanticModel value : checkSemanticModelMap.values()) {
String field = value.getField();
@ -1099,7 +1099,8 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
//没有匹配结果
responseBody.put("taskResult",1);
}else{
long count = ocrResultDTOList.stream().filter(o -> !o.getRuleValidation()).count();
long count = fieldRightMap.values().stream().filter(o->!o).count();
//long count = ocrResultDTOList.stream().filter(o -> !o.getRuleValidation()).count();
responseBody.put("taskResult",count>0?0:1);//匹配成功或失败
}

Loading…
Cancel
Save