Skip to content
Snippets Groups Projects
Unverified Commit 6f7fbdc9 authored by 罗崚骁's avatar 罗崚骁 Committed by GitHub
Browse files

Merge pull request #158 from function2-llx/master

fix version issue
parents c917b0f5 341c1198
No related branches found
No related tags found
No related merge requests found
...@@ -78,6 +78,11 @@ def extract_gt(test_data): ...@@ -78,6 +78,11 @@ def extract_gt(test_data):
# for unifying values with the same meaning to the same expression # for unifying values with the same meaning to the same expression
def unify_value(value, subtask): def unify_value(value, subtask):
if isinstance(value, list):
for i, v in enumerate(value):
value[i] = unify_value(v, subtask)
return value
value = value.lower() value = value.lower()
value = { value = {
'multiwoz': { 'multiwoz': {
...@@ -132,7 +137,7 @@ def eval_states(gt, pred, subtask): ...@@ -132,7 +137,7 @@ def eval_states(gt, pred, subtask):
pred_value = unify_value(pred_domain[slot_name], subtask) pred_value = unify_value(pred_domain[slot_name], subtask)
slot_tot += 1 slot_tot += 1
if gt_value == pred_value: if gt_value == pred_value or isinstance(gt_value, list) and pred_value in gt_value:
slot_acc += 1 slot_acc += 1
if gt_value: if gt_value:
tp += 1 tp += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment