commit
131c63454a
@ -536,6 +536,10 @@ def first_of_list(the_list):
|
|||||||
return the_list[0]
|
return the_list[0]
|
||||||
|
|
||||||
def _feedback_invoice_no_exist(feedback_result):
|
def _feedback_invoice_no_exist(feedback_result):
|
||||||
|
if feedback_result is None:
|
||||||
|
return True
|
||||||
|
if not isinstance(feedback_result, dict):
|
||||||
|
return True
|
||||||
invoice_no = feedback_result.get("invoice_no", None)
|
invoice_no = feedback_result.get("invoice_no", None)
|
||||||
if invoice_no in ["", [], None]:
|
if invoice_no in ["", [], None]:
|
||||||
return False
|
return False
|
||||||
@ -700,8 +704,7 @@ def calculate_accuracy(key_name: str, inference: Dict[str, Union[str, List]], ta
|
|||||||
_inference = inference[key_name]
|
_inference = inference[key_name]
|
||||||
_target = target[key_name]
|
_target = target[key_name]
|
||||||
_will_acc_be_ignored = _acc_will_be_ignored(key_name, _target, type)
|
_will_acc_be_ignored = _acc_will_be_ignored(key_name, _target, type)
|
||||||
_inference = _accuracy_calculate_formatter(_inference)
|
_inference, _target = _accuracy_calculate_formatter(_inference, _target)
|
||||||
_target = _accuracy_calculate_formatter(_target)
|
|
||||||
|
|
||||||
for i, v in enumerate(_inference):
|
for i, v in enumerate(_inference):
|
||||||
# TODO: target[i] is None, ""
|
# TODO: target[i] is None, ""
|
||||||
@ -860,13 +863,12 @@ def calculate_a_request(report, request):
|
|||||||
image.reviewed_result["purchase_date"] = att["normalized_data"]["reviewed"]["purchase_date"][rv_max_indexes["purchase_date"]][1]
|
image.reviewed_result["purchase_date"] = att["normalized_data"]["reviewed"]["purchase_date"][rv_max_indexes["purchase_date"]][1]
|
||||||
request_att["is_reviewed"].append(att["is_reviewed"])
|
request_att["is_reviewed"].append(att["is_reviewed"])
|
||||||
|
|
||||||
if att["is_reviewed"] == -1: # -1 means "not required"
|
if att["is_reviewed"] !=1:
|
||||||
att["acc"]["reviewed"] = {}
|
att["acc"]["reviewed"] = {}
|
||||||
reviewed_result = {}
|
reviewed_result = {}
|
||||||
reason = None
|
reason = None
|
||||||
counter_measure = None
|
counter_measure = None
|
||||||
else:
|
else:
|
||||||
if att["is_reviewed"] == 1:
|
|
||||||
reviewed_result = image.reviewed_result
|
reviewed_result = image.reviewed_result
|
||||||
reason = image.reason
|
reason = image.reason
|
||||||
counter_measure = image.counter_measures
|
counter_measure = image.counter_measures
|
||||||
|
Loading…
Reference in New Issue
Block a user