|
|
|
@ -994,8 +994,6 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
text = null;
|
|
|
|
|
text = ocrItem.getString("text");//ocr 识别的文本
|
|
|
|
|
probability = ocrItem.getDouble("probability");//置信度
|
|
|
|
|
log.info("ocrItem:");
|
|
|
|
|
log.info(ocrItem.toJSONString());
|
|
|
|
|
if ("101".equals(ruleInfo)) {
|
|
|
|
|
if (StringUtils.isBlank(text) || StringUtils.isBlank(inputText)) {
|
|
|
|
|
//没识别值
|
|
|
|
@ -1063,10 +1061,6 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
fieldRightMap.put(field, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
System.out.println("----------------------");
|
|
|
|
|
for (OcrResultDTO result : ocrResultDTOList) {
|
|
|
|
|
System.out.println(result.toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Date overDataCheckTime = new Date();
|
|
|
|
|
|
|
|
|
@ -1078,11 +1072,15 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
//OCR和NlU执行时间总和(秒)
|
|
|
|
|
double ocrAndNluTimeSum = identifyDetailList.stream().mapToDouble(i -> (i.getOcrTime() == null ? 0 : i.getOcrTime()) + (i.getNluTime() == null ? 0 : i.getNluTime())).sum();
|
|
|
|
|
//执行时间(毫秒)
|
|
|
|
|
double executionTime = (ocrAndNluTimeSum * 1000) + overDataCheckTime.getTime() - startDataCheckTime.getTime();
|
|
|
|
|
double dataStructuredTime = overDataCheckTime.getTime() - startDataCheckTime.getTime();
|
|
|
|
|
double executionTime = (ocrAndNluTimeSum * 1000) + dataStructuredTime;
|
|
|
|
|
responseBody.put("min",min);
|
|
|
|
|
responseBody.put("max",max);
|
|
|
|
|
responseBody.put("executionTime",executionTime);
|
|
|
|
|
responseBody.put("dataStructuredTime",dataStructuredTime);
|
|
|
|
|
responseBody.put("allExecutionTime",executionTime);
|
|
|
|
|
responseBody.put("detailList", ocrResultDTOList);
|
|
|
|
|
long count = ocrResultDTOList.stream().filter(o -> !o.getRuleValidation()).count();
|
|
|
|
|
responseBody.put("taskResult",count>0?0:1);//匹配成功或失败
|
|
|
|
|
return responseBody;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|