From 2d65be3bc382dc3722e5a885333e919912886613 Mon Sep 17 00:00:00 2001 From: zhouwentao <1577701412@qq.com> Date: Wed, 30 Aug 2023 17:06:59 +0800 Subject: [PATCH] updates --- .../modules/ocr/service/impl/OcrIdentifyServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/ocr/service/impl/OcrIdentifyServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/ocr/service/impl/OcrIdentifyServiceImpl.java index 8c3b6d5..78e06d5 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/ocr/service/impl/OcrIdentifyServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/ocr/service/impl/OcrIdentifyServiceImpl.java @@ -942,6 +942,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl ocrResultDTOList = new ArrayList<>(); Date startDataCheckTime = new Date(); + Map 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 fieldRightMap = new LinkedHashMap<>();//存放 字段判断正确map //========================== checkSemanticFor: for (CheckSemanticModel value : checkSemanticModelMap.values()) { String field = value.getField(); @@ -1099,7 +1099,8 @@ public class OcrIdentifyServiceImpl extends ServiceImpl !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);//匹配成功或失败 }