Spaces:
Running
on
Zero
Running
on
Zero
load reference answer
Browse files- utils/data_loader.py +4 -2
utils/data_loader.py
CHANGED
@@ -43,7 +43,8 @@ def create_dummy_example():
|
|
43 |
"full_contexts": [],
|
44 |
"Answerable": False,
|
45 |
"insufficient": True,
|
46 |
-
"insufficient_reason": "Data loading error"
|
|
|
47 |
}
|
48 |
|
49 |
def get_random_example():
|
@@ -67,7 +68,8 @@ def get_random_example():
|
|
67 |
"Answerable": not example.get('insufficient', False),
|
68 |
"insufficient": example.get('insufficient', False),
|
69 |
"insufficient_reason": example.get('insufficient_reason', ''),
|
70 |
-
"sample_id": example.get('sample_id', 0)
|
|
|
71 |
}
|
72 |
|
73 |
# Process the context description - ensure it's a non-empty string
|
|
|
43 |
"full_contexts": [],
|
44 |
"Answerable": False,
|
45 |
"insufficient": True,
|
46 |
+
"insufficient_reason": "Data loading error",
|
47 |
+
"answer": "No reference answer available due to data loading error."
|
48 |
}
|
49 |
|
50 |
def get_random_example():
|
|
|
68 |
"Answerable": not example.get('insufficient', False),
|
69 |
"insufficient": example.get('insufficient', False),
|
70 |
"insufficient_reason": example.get('insufficient_reason', ''),
|
71 |
+
"sample_id": example.get('sample_id', 0),
|
72 |
+
"answer": example.get('answer', '') # NEW: Extract reference answer from CSV
|
73 |
}
|
74 |
|
75 |
# Process the context description - ensure it's a non-empty string
|