Datasets:

Modalities:
Text
Formats:
csv
Languages:
Arabic
ArXiv:
License:
nurkhan5l commited on
Commit
4aa23b0
·
verified ·
1 Parent(s): acddfba

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +104 -0
  2. apply_filter.py +55 -0
  3. ids.csv +0 -0
README.md ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ size_categories:
4
+ - 10K<n<100K
5
+ language:
6
+ - ar
7
+ task_categories:
8
+ - multiple-choice
9
+ pretty_name: AraSTEM (verified)
10
+ configs:
11
+ - config_name: default
12
+ data_files:
13
+ - split: test
14
+ path: ids.csv
15
+ ---
16
+
17
+ # AraSTEM (verified)
18
+
19
+ A filtered version of **AraSTEM**, a native Arabic multiple-choice benchmark of STEM questions from school and college sources, with samples flagged by a multi-judge audit removed. The verified set has one config per level and subject (14 configs, `<level>_<subject>`).
20
+
21
+ > **What "verified" means.** Samples were removed when all three LLM judges flagged a significant defect. This is not a human review, and only samples that baseline models answered incorrectly were audited, so some defects may remain in the kept data.
22
+
23
+ **This repository does not contain the AraSTEM questions.** The source repository is public but states no license, so we publish the filter instead: which source rows to keep, plus a script that applies it to the source.
24
+
25
+ ## How to use
26
+
27
+ ```bash
28
+ pip install pandas pyarrow huggingface_hub
29
+ python apply_filter.py arastem_verified
30
+ ```
31
+
32
+ [`apply_filter.py`](apply_filter.py) downloads the source file from GitHub at the commit below, checks every row against the fingerprints in `ids.csv`, splits it by `level` and `subject`, and writes the 10,494-row verified set as one parquet file per config (`arastem_verified/<level>_<subject>.parquet`, e.g. `primary_math.parquet`). It stops with an error if the source has changed.
33
+
34
+ Or filter it yourself:
35
+
36
+ ```python
37
+ import json, urllib.request
38
+ import pandas as pd
39
+
40
+ ids = pd.read_csv("hf://datasets/IFM/AraSTEM_verified/ids.csv")
41
+ url = "https://raw.githubusercontent.com/AI-DSCHubAUB/AraSTEM-Dataset/d8f8fdd4e420df45737df1105a60a34b9b4aecd2/AraSTEMv5.json"
42
+ source = pd.DataFrame(json.load(urllib.request.urlopen(url)))
43
+ kept = ids["status"].eq("kept").to_numpy()
44
+ verified = source[kept].reset_index(drop=True) # 10,494 rows
45
+ config = ids.loc[kept, "config"].reset_index(drop=True)
46
+ primary_math = verified[config.eq("primary_math")].reset_index(drop=True) # 2,774 rows
47
+ ```
48
+
49
+ ## Files
50
+ - `ids.csv`: one row per source row (10,824 rows):
51
+ - `row`: the 0-based row index in the source file.
52
+ - `config`: `<level>_<subject>` from the source `level` and `subject` (spaces replaced by `_`, e.g. `college_information_technology`).
53
+ - `status`: `kept` (10,494) or `removed` (330).
54
+ - `fingerprint`: the first 16 hex characters of a SHA-256 over the row's `question`, `option_0`–`option_4`, `correct_option`, `level`, `subject` and `resource` (as text, joined by `\x1f`), used to detect changes in the source.
55
+ - `apply_filter.py`: rebuilds the verified set from the source.
56
+
57
+ ## Source
58
+ - Original dataset: GitHub [`AI-DSCHubAUB/AraSTEM-Dataset`](https://github.com/AI-DSCHubAUB/AraSTEM-Dataset), commit `d8f8fdd4e420df45737df1105a60a34b9b4aecd2`, file `AraSTEMv5.json` (10,824 questions). Splitting that file by `level` and `subject` reproduces the evaluation files exactly; each config is one such split after filtering.
59
+ - Columns of the rebuilt set, as in the source: `question`, `option_0`–`option_4` (unused options are empty strings), `correct_option` (the 0-based index of the correct option, an integer), `level`, `subject` and `resource` (source reference).
60
+
61
+ ## Audit and filtering
62
+
63
+ Samples were screened with the multi-judge audit described in [`IFM/discarded_samples`](https://huggingface.co/datasets/IFM/discarded_samples) (config `AraSTEM`). Three language-model judges (GPT-5.6 Sol, Gemini 3.8 Flash, Claude Opus 5) assessed candidate samples that strong baselines answered incorrectly. A sample is excluded only when **all three** judges report a *significant* issue (a problem with the question, the options or the gold label that prevents reliable answering or scoring). Each discarded record's `doc_id` is the 0-based position of the sample within its `<level>_<subject>` split of the source file; `ids.csv` gives the matching source row (`row`) for each excluded sample. All other rows are kept unchanged and in their original order.
64
+
65
+ | Config | Original rows | Excluded | Kept |
66
+ |---|---:|---:|---:|
67
+ | `college_biology` | 588 | 21 | 567 |
68
+ | `college_chemistry` | 326 | 34 | 292 |
69
+ | `college_dentistry` | 632 | 29 | 603 |
70
+ | `college_information_technology` | 369 | 38 | 331 |
71
+ | `college_medicine` | 721 | 31 | 690 |
72
+ | `college_pharmacy` | 423 | 15 | 408 |
73
+ | `college_physics` | 137 | 4 | 133 |
74
+ | `primary_math` | 2,822 | 48 | 2,774 |
75
+ | `primary_science` | 3,868 | 66 | 3,802 |
76
+ | `secondary_biology` | 322 | 9 | 313 |
77
+ | `secondary_chemistry` | 237 | 9 | 228 |
78
+ | `secondary_math` | 84 | 3 | 81 |
79
+ | `secondary_physics` | 180 | 7 | 173 |
80
+ | `secondary_science` | 115 | 16 | 99 |
81
+ | **Total** | **10,824** | **330** | **10,494** |
82
+
83
+ ## License
84
+ The source repository states no license, so its content remains all rights reserved by its authors, and this repository redistributes none of its text. The files here (`ids.csv`, `apply_filter.py` and this card) are released under CC BY 4.0. The verified set you build from the source remains subject to the source's terms.
85
+
86
+ ## Citation
87
+ Please cite the original authors:
88
+
89
+ ```bibtex
90
+ @article{mustapha2024arastem,
91
+ title = {AraSTEM: A Native Arabic Multiple Choice Question Benchmark for Evaluating LLMs Knowledge In STEM Subjects},
92
+ author = {Mustapha, Ahmad and Al-Khansa, Hadi and Al-Mubasher, Hadi and Mourad, Aya and Hamoud, Ranam and El-Husseini, Hasan and Al-Sakkaf, Marwah and Awad, Mariette},
93
+ journal = {arXiv preprint arXiv:2501.00559},
94
+ year = {2024},
95
+ url = {https://arxiv.org/abs/2501.00559}
96
+ }
97
+
98
+ @misc{jais3_2026,
99
+ title = {Jais 3: Introducing Arabic-centric Agentic AI},
100
+ author = {{IFM Team}},
101
+ year = {2026},
102
+ url = {https://ifm.ai/blog/jais3/},
103
+ }
104
+ ```
apply_filter.py ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Rebuild the verified AraSTEM configs from the public source file on GitHub.
2
+
3
+ Usage:
4
+ python apply_filter.py [output_dir]
5
+
6
+ Writes one parquet file per config, <output_dir>/<level>_<subject>.parquet.
7
+ """
8
+ import hashlib
9
+ import json
10
+ import os
11
+ import sys
12
+ import urllib.request
13
+
14
+ import pandas as pd
15
+ from huggingface_hub import hf_hub_download
16
+
17
+ SOURCE = "AI-DSCHubAUB/AraSTEM-Dataset"
18
+ SOURCE_REVISION = "d8f8fdd4e420df45737df1105a60a34b9b4aecd2"
19
+ SOURCE_URL = f"https://raw.githubusercontent.com/{SOURCE}/{SOURCE_REVISION}/AraSTEMv5.json"
20
+ THIS_REPO = "IFM/AraSTEM_verified"
21
+ COLUMNS = ["question", "option_0", "option_1", "option_2", "option_3", "option_4",
22
+ "correct_option", "level", "subject", "resource"]
23
+ EXPECTED_KEPT = {
24
+ "college_biology": 567, "college_chemistry": 292, "college_dentistry": 603,
25
+ "college_information_technology": 331, "college_medicine": 690, "college_pharmacy": 408,
26
+ "college_physics": 133, "primary_math": 2774, "primary_science": 3802,
27
+ "secondary_biology": 313, "secondary_chemistry": 228, "secondary_math": 81,
28
+ "secondary_physics": 173, "secondary_science": 99,
29
+ }
30
+
31
+
32
+ def fingerprint(row):
33
+ return hashlib.sha256("\x1f".join(str(row[c]) for c in COLUMNS).encode()).hexdigest()[:16]
34
+
35
+
36
+ ids = pd.read_csv(hf_hub_download(THIS_REPO, "ids.csv", repo_type="dataset"))
37
+ with urllib.request.urlopen(SOURCE_URL) as f:
38
+ source = pd.DataFrame(json.load(f), columns=COLUMNS)
39
+ assert len(source) == len(ids), f"expected {len(ids)} source rows, got {len(source)}"
40
+ mismatch = [i for i, row in source.iterrows() if fingerprint(row) != ids.at[i, "fingerprint"]]
41
+ assert not mismatch, f"source rows differ from the audited version: {mismatch[:10]}"
42
+
43
+ config = (source["level"] + "_" + source["subject"]).str.replace(" ", "_")
44
+ assert config.equals(ids["config"]), "config labels differ from ids.csv"
45
+ kept = ids["status"].eq("kept").to_numpy()
46
+
47
+ out = sys.argv[1] if len(sys.argv) > 1 else "arastem_verified"
48
+ os.makedirs(out, exist_ok=True)
49
+ for name, expected in EXPECTED_KEPT.items():
50
+ verified = source[kept & config.eq(name).to_numpy()].reset_index(drop=True)
51
+ assert len(verified) == expected, f"{name}: expected {expected} rows, got {len(verified)}"
52
+ verified.to_parquet(os.path.join(out, f"{name}.parquet"))
53
+ total = sum(EXPECTED_KEPT.values())
54
+ assert total == int(kept.sum()) == 10494
55
+ print(f"Wrote {total} rows in {len(EXPECTED_KEPT)} configs to {out}/")
ids.csv ADDED
The diff for this file is too large to render. See raw diff