mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Remove duplicate samples (#3899)
* Remove duplicate samples * Correct paths * Update readme * Update readme * Fix ruff --------- Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
1441fd903c
commit
e064f943ae
@@ -186,7 +186,7 @@ def gaia_scorer(model_answer: str, ground_truth: str) -> bool:
|
||||
|
||||
if is_float(ground_truth):
|
||||
# numeric exact match after normalization
|
||||
return _normalize_number_str(model_answer) == float(ground_truth)
|
||||
return abs(_normalize_number_str(model_answer) - float(ground_truth)) < 1e-6
|
||||
if any(ch in ground_truth for ch in [",", ";"]):
|
||||
# list with per-element compare (number or string)
|
||||
gt_elems = _split_string(ground_truth)
|
||||
@@ -196,7 +196,7 @@ def gaia_scorer(model_answer: str, ground_truth: str) -> bool:
|
||||
comparisons = []
|
||||
for ma, gt in zip(ma_elems, gt_elems, strict=False):
|
||||
if is_float(gt):
|
||||
comparisons.append(_normalize_number_str(ma) == float(gt))
|
||||
comparisons.append(abs(_normalize_number_str(ma) - float(gt)) < 1e-6)
|
||||
else:
|
||||
comparisons.append(_normalize_str(ma, remove_punct=False) == _normalize_str(gt, remove_punct=False))
|
||||
return all(comparisons)
|
||||
|
||||
Reference in New Issue
Block a user