fix wrong accuracy invoice no
This commit is contained in:
parent
5a4d75691b
commit
ce3f3af3a2
@ -678,10 +678,10 @@ def _accuracy_calculate_formatter(inference, target):
|
|||||||
|
|
||||||
return inference, target
|
return inference, target
|
||||||
|
|
||||||
def _acc_will_be_ignored(key_name, _target, type):
|
def _acc_will_be_ignored(key_name, _target):
|
||||||
is_optional_key = key_name in optional_keys
|
is_optional_key = key_name in optional_keys
|
||||||
is_empty_target = _target in [[], None, '']
|
is_empty_target = _target in [[], None, '']
|
||||||
if is_optional_key and is_empty_target and type == 'feedback':
|
if is_optional_key and is_empty_target:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
@ -703,7 +703,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)
|
||||||
_inference, _target = _accuracy_calculate_formatter(_inference, _target)
|
_inference, _target = _accuracy_calculate_formatter(_inference, _target)
|
||||||
|
|
||||||
for i, v in enumerate(_inference):
|
for i, v in enumerate(_inference):
|
||||||
|
Loading…
Reference in New Issue
Block a user