Spaces:
Sleeping
Sleeping
Update evaluation.py
Browse files- evaluation.py +2 -2
evaluation.py
CHANGED
@@ -102,7 +102,7 @@ def convert_adherence_to_numerical(adherence_score):
|
|
102 |
else:
|
103 |
return 0 # False becomes 0
|
104 |
|
105 |
-
def retrieve_ground_truths(question, dataset):
|
106 |
"""Retrieve the ground truth answer for a given question from the dataset."""
|
107 |
for split_name, instances in dataset.items():
|
108 |
for instance in instances:
|
@@ -145,7 +145,7 @@ def store_rmse(question, predicted_metrics, ground_truth_metrics):
|
|
145 |
|
146 |
def calculate_metrics(question, q_dataset, response, docs, time_taken):
|
147 |
data = load_query_dataset(q_dataset)
|
148 |
-
ground_truth_answer, ground_truth_metrics = retrieve_ground_truths(question, data) # Store the ground truth answer
|
149 |
|
150 |
# Ensure ground_truth_answer is not empty before proceeding
|
151 |
if ground_truth_answer is None:
|
|
|
102 |
else:
|
103 |
return 0 # False becomes 0
|
104 |
|
105 |
+
def retrieve_ground_truths(question, dataset,time_taken):
|
106 |
"""Retrieve the ground truth answer for a given question from the dataset."""
|
107 |
for split_name, instances in dataset.items():
|
108 |
for instance in instances:
|
|
|
145 |
|
146 |
def calculate_metrics(question, q_dataset, response, docs, time_taken):
|
147 |
data = load_query_dataset(q_dataset)
|
148 |
+
ground_truth_answer, ground_truth_metrics = retrieve_ground_truths(question, data,time_taken) # Store the ground truth answer
|
149 |
|
150 |
# Ensure ground_truth_answer is not empty before proceeding
|
151 |
if ground_truth_answer is None:
|