update for ragas
This commit is contained in:
@@ -159,7 +159,8 @@ def _select_low_samples(
|
||||
valid = [r for r in rows if metric in r and not math.isnan(float(r[metric]))]
|
||||
sorted_rows = sorted(valid, key=lambda r: float(r[metric]), reverse=not higher_is_better)
|
||||
worst = sorted_rows[:top_n]
|
||||
keep_keys = {"sample_id", "question", "answer", "ground_truth", metric}
|
||||
# contexts is included so the LLM/fallback can judge grounding (retrieval vs generation).
|
||||
keep_keys = {"sample_id", "question", "answer", "ground_truth", "contexts", metric}
|
||||
return [{k: v for k, v in row.items() if k in keep_keys} for row in worst]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user