回传匹配度调整
chj_ocr
周文涛 2 years ago
parent 4a0b5f2393
commit d519ba7f2d

@ -32,14 +32,14 @@ public class CallBackWlyUtils {
//请求对象 //请求对象
CallBackWlyResult result = new CallBackWlyResult(); CallBackWlyResult result = new CallBackWlyResult();
List<JSONObject> taskResultInfoList=null; List<JSONObject> jsonObjects=new ArrayList<>();
//总明细数量 //总明细数量
int detail_detailCount = 0; int detail_detailCount = 0;
int detailValidationCount=0; int detailValidationCount=0;
String taskResultInfo = ocrIdentify.getTaskResultInfo(); String taskResultInfo = ocrIdentify.getTaskResultInfo();
if (StringUtils.isNotBlank(taskResultInfo)) { if (StringUtils.isNotBlank(taskResultInfo)) {
//循环获取哪些字段通过了 //循环获取哪些字段通过了
taskResultInfoList = JSONArray.parseArray(taskResultInfo).toJavaList(JSONObject.class); List<JSONObject> taskResultInfoList = JSONArray.parseArray(taskResultInfo).toJavaList(JSONObject.class);
detail_detailCount=taskResultInfoList.size(); detail_detailCount=taskResultInfoList.size();
for (JSONObject jsonObject : taskResultInfoList) { for (JSONObject jsonObject : taskResultInfoList) {
Boolean ruleValidation = (Boolean) jsonObject.getOrDefault("ruleValidation", false); Boolean ruleValidation = (Boolean) jsonObject.getOrDefault("ruleValidation", false);
@ -50,6 +50,16 @@ public class CallBackWlyUtils {
} }
} }
for (OcrIdentifyDetail identifyDetail : identifyDetails) {
if (StringUtils.isNotBlank(identifyDetail.getDataStructured())) {
List<JSONObject> jsonObjects1 = JSONArray.parseArray(identifyDetail.getDataStructured()).toJavaList(JSONObject.class);
if (CollectionUtils.isNotEmpty(jsonObjects1)) {
jsonObjects.addAll(jsonObjects1);
}
}
}
//组装回调参数 //组装回调参数
//成功率 //成功率
double imageTagRetrievePercentage = 0.0d; double imageTagRetrievePercentage = 0.0d;
@ -65,10 +75,10 @@ public class CallBackWlyUtils {
result.setImageTagRetrievePercentage(imageTagRetrievePercentage + ""); result.setImageTagRetrievePercentage(imageTagRetrievePercentage + "");
result.setRetrieveReviewCompliance(imageTagRetrievePercentage+""); result.setRetrieveReviewCompliance(imageTagRetrievePercentage+"");
result.setFailureReason(ocrIdentify.getErrorMsg()); result.setFailureReason(ocrIdentify.getErrorMsg());
if (CollectionUtils.isEmpty(taskResultInfoList)) { if (CollectionUtils.isEmpty(jsonObjects)) {
return false; return false;
} }
result.setOcrResult(taskResultInfoList); result.setOcrResult(jsonObjects);
log.info("请求无量云回调接口"); log.info("请求无量云回调接口");
JSONObject semanticResponseJson = null; JSONObject semanticResponseJson = null;

Loading…
Cancel
Save