From 798f57c341969f7308586a8aaee4f2124541be12 Mon Sep 17 00:00:00 2001 From: Wenshansilvia Date: Fri, 15 Nov 2024 15:50:16 +0800 Subject: [PATCH] add claimnum claimfaithfulness repetitiveness --- rageval/metrics/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rageval/metrics/base.py b/rageval/metrics/base.py index 651c404..0fb1140 100644 --- a/rageval/metrics/base.py +++ b/rageval/metrics/base.py @@ -68,7 +68,10 @@ def compute( Return average scores of all inputs and a score list for each example. """ self._validate_data(pred_answers, ref_answers, *args) - scores = self._compute_batch(pred_answers, ref_answers, contexts, *args) + if contexts: + scores = self._compute_batch(pred_answers, ref_answers, contexts, *args) + else: + scores = self._compute_batch(pred_answers, ref_answers, *args) return np.average(scores), scores