Datasets:
Add missing paper_id field to dataset features
Browse filesThe JSONL contains paper_id on JEE Advanced rows (198/578). HuggingFace
was failing with CastError because the column existed in data but wasn't
declared in dataset_info features.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- README.md +2 -0
- src/benchmark_runner.py +2 -0
README.md
CHANGED
|
@@ -36,6 +36,8 @@ dataset_info:
|
|
| 36 |
dtype: string
|
| 37 |
- name: correct_answer
|
| 38 |
dtype: string
|
|
|
|
|
|
|
| 39 |
splits:
|
| 40 |
- name: test
|
| 41 |
num_examples: 578
|
|
|
|
| 36 |
dtype: string
|
| 37 |
- name: correct_answer
|
| 38 |
dtype: string
|
| 39 |
+
- name: paper_id
|
| 40 |
+
dtype: int64
|
| 41 |
splits:
|
| 42 |
- name: test
|
| 43 |
num_examples: 578
|
src/benchmark_runner.py
CHANGED
|
@@ -484,6 +484,7 @@ def run_benchmark(
|
|
| 484 |
for line in f:
|
| 485 |
row = json.loads(line)
|
| 486 |
row["image"] = os.path.join(images_base_dir, row["image"])
|
|
|
|
| 487 |
records.append(row)
|
| 488 |
|
| 489 |
features = Features({
|
|
@@ -494,6 +495,7 @@ def run_benchmark(
|
|
| 494 |
"subject": Value("string"),
|
| 495 |
"question_type": Value("string"),
|
| 496 |
"correct_answer": Value("string"),
|
|
|
|
| 497 |
})
|
| 498 |
dataset = Dataset.from_list(records, features=features)
|
| 499 |
logging.info(f"Dataset loaded successfully from {metadata_path}. Original number of questions: {len(dataset)}")
|
|
|
|
| 484 |
for line in f:
|
| 485 |
row = json.loads(line)
|
| 486 |
row["image"] = os.path.join(images_base_dir, row["image"])
|
| 487 |
+
row.setdefault("paper_id", None)
|
| 488 |
records.append(row)
|
| 489 |
|
| 490 |
features = Features({
|
|
|
|
| 495 |
"subject": Value("string"),
|
| 496 |
"question_type": Value("string"),
|
| 497 |
"correct_answer": Value("string"),
|
| 498 |
+
"paper_id": Value("int64"),
|
| 499 |
})
|
| 500 |
dataset = Dataset.from_list(records, features=features)
|
| 501 |
logging.info(f"Dataset loaded successfully from {metadata_path}. Original number of questions: {len(dataset)}")
|