Datasets:
File size: 13,380 Bytes
484cdfd 068bed8 484cdfd e461114 6fe55e3 486a12e 484cdfd 486a12e 484cdfd 486a12e 484cdfd 068bed8 484cdfd 486a12e 484cdfd 486a12e 484cdfd 486a12e 484cdfd 486a12e 484cdfd 486a12e 484cdfd 486a12e 484cdfd 486a12e 484cdfd 486a12e 484cdfd 486a12e 484cdfd 486a12e 484cdfd 486a12e 484cdfd 486a12e 484cdfd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
---
task_categories:
- text-generation
language:
- it
size_categories:
- 1K<n<10K
configs:
- config_name: italian
data_files:
- split: test
path: medical_school_questions.jsonl
tags:
- culture
- knowledge
- chemistry
- biology
- math
- reasoning
pretty_name: Test di Medicina
---
# Medschool-Test, or *"Test di Medicina"*
<p align="center">
<img src="test-medicina.jpg" />
</p>
## Is your LLM able to pass a National Entrance Exam for the Italian Medical School?
This the GitHub repo for our Hugging Face dataset designed for evaluating Large Language Models (LLMs) on a broad range of questions from the **national entrance exams for the Italian medical school** ([ORIGINAL WEBSITE](https://domande-ap.mur.gov.it/domande)).
The dataset includes multiple-choice questions from various subjects such as biology, chemistry, physics, mathematics, world knowledge, and more.
Each question is accompanied by five answer choices, with one correct answer. The following is an example:
```json
{
"id": 1691,
"topic": "biologia",
"text": "Come sono definite le cellule staminali che sono in grado di differenziarsi in tutti i tipi di cellule presenti nel corpo umano, ma non possono dare origine ad un organismo completo?",
"answers": [
"Cellule Staminali Multipotenti",
"Cellule Staminali Pluripotenti",
"Cellule Staminali Totipotenti",
"Cellule Staminali Unipotenti",
"Cellule Staminali Oligopotenti"
],
"label": 1
}
```
**The dataset is available on Hugging Face 🤗!** 👉👉 [LINK](https://huggingface.co/datasets/room-b007/test-medicina) 👈👈.
## Features
- **Italian (and English coming soon)**: The dataset is currently available in Italian, with an English version coming soon.
- **Multiple topics**: Questions cover a wide range of subjects, including biology, chemistry, physics, mathematics, world knowledge (with a focus on Italian culture), and more.
- **"Multiple-choice" and "Cloze-style" formats**: Each question has five answer choices, with one correct answer. This dataset is designed to evaluate LLMs on both multiple-choice and cloze-style questions. More specifically, each question is presented in the following formats:
- **Multiple-choice**: The question is followed by five answer choices, with one correct answer. The evaluation metrics is based on the model's ability to select the correct answer when presented with the question and answer choices.
- **Cloze-style**: The question is NOT followed by answer choices. The evaluation metric is based on the model's ability to generate the correct answer when presented with the question only.
- **Large-scale**: The dataset contains over 3K high-quality questions, making it suitable for the evaluation of LLMs.
## Evaluation
The dataset is designed to evaluate LLMs on a wide range of questions from medical school entrance exams. The evaluation metrics are based on the model's ability to select the correct answer when presented with the question and answer choices (multiple-choice format) or generate the correct answer when presented with the question only (cloze-style format).
### Leaderboard
> [!NOTE]
> Coming soon!
### Scoring
For each question, the model obtains a score ranging from -0.4 to 1.5, based on the following criteria:
- **Correct Answer**: If the model selects the correct answer, it receives a score of 1.5.
- **Incorrect Answer**: If the model selects an incorrect answer, it receives a score of -0.4.
- **No Answer**: If the model does not select any answer, it receives a score of 0.0.
The final score is calculated as the weighted average of the scores obtained on all questions, where the weight of each question depends on the topic of the question, as follows:
| Subject | Score | Weight |
|--------------------|-------|----------|
| Biology | 23/60 | 0.3833 |
| Chemistry | 15/60 | 0.25 |
| Math & Physics | 13/60 | 0.2167 |
| World Knowledge | 4/60 | 0.0667 |
| Logic & Reasoning | 5/60 | 0.0833 |
This is the same scoring system used for the official Italian medical school entrance exams.
### Evaluation Script
The evaluation script is available on our GitHub repo! [Check it out](https://github.com/room-b007/test-medicina)!
The evaluation is based on the `lm-evaluation-harness` library, which provides a simple and flexible way to evaluate LLMs on a wide range of tasks and datasets. The tasks are defined in `tasks/medschool-test`.
#### Requirements and Installation
We recommend using Conda to create a new environment and install the required libraries. You can create a new Conda environment using the following command:
```bash
conda create -n medschool-test python=3.10
conda activate medschool-test
```
> [!NOTE]
> Using Conda is optional but highly recommended to avoid conflicts with existing libraries.
To run the evaluation, you need to install the `lm-evaluation-harness` library and the `transformers` library. You can install them using the following command:
```bash
pip install --upgrade -r requirements.txt
```
#### Running the Evaluation Script
To run the evaluation, you can use the following command:
```bash
# Model to evaluate: meta-llama/Meta-Llama-3.1-8B-Instruct (in bfloat16)
MODEL_ARGS="pretrained=meta-llama/Meta-Llama-3.1-8B-Instruct,dtype=bfloat16"
# Evaluate the model on both multiple-choice and cloze-style formats
TASKS="medschool_test_it_mc,medschool_test_it_cloze"
# Create the output directory if it does not exist
OUTPUT_DIR="outputs/"
mkdir -p $OUTPUT_DIR
# Run the evaluation with the lm-evaluation-harness library
accelerate launch -m lm_eval \
--model hf \
--model_args $MODEL_ARGS \
--tasks $TASKS \
--batch_size auto \
--log_samples \
--output_path $OUTPUT_DIR \
--include tasks/medschool-test/
```
This command evaluates the model `meta-llama/Meta-Llama-3.1-8B-Instruct` on the Italian version of the dataset in both multiple-choice and cloze-style formats. The evaluation results are saved in the `outputs/` directory.
Please, refer to the examples in `examples/evaluation` or [lm-evaluation-harness](https://github.com/eleutherai/lm-evaluation-harness) repository for more details on how to use the library.
> [!NOTE]
> The scores provided by the evaluation script are 5, one for each subject, and they are between -0.4 and 1.5. They, the subject-scores, are computed as the average score over all the questions for each specific subject. To get the final score, you need to calculate the weighted average of the subject-scores, where the weight of each subject-score depends on the subject itself (as described in the "Scoring" section above).
>
> For example, if the model obtains the following subject-scores:
> - Biology: 1.0571
> - Chemistry: 0.7598
> - Knowledge: 1.0518
> - Reasoning: 0.2005
> - Math & Physics: 0.4302
>
> The final score is calculated as follows:
> ```
> average_score_per_question = (1.0571 * 0.3833) + (0.7598 * 0.25) + (1.0518 * 0.0667) + (0.2005 * 0.0833) + (0.4302 * 0.2167) = 0.7752
> overall_score = average_per_question * 60 = 46.51
> ```
> The <u> maximum possible score is 90 = 60 * 1.5 </u>, when all the answers are correct, while the <u> minum score is -24 = 60 * -0.4 </u>, when all the answers are incorrect.
## Data
### Source
The dataset is collected from the official Italian website of the Ministry of Education, University and Research ([MIUR](https://www.miur.gov.it/)), which hosts a large collection of past entrance exams for medical school in Italy. The dataset includes questions from various subjects, such as biology, chemistry, physics, mathematics, world knowledge, and more. You can find the original dataset [HERE](https://domande-ap.mur.gov.it/domande).
### Composition
The dataset contains over 3K questions, making it suitable for training and evaluating LLMs. The following table shows the number of questions in the dataset for each subject:
| Subject | Number of questions |
|---------------|---------------------|
| Biology | 1,180 |
| Chemistry | 1,009 |
| Math & Physics | 655 |
| World knowledge | 245 |
| Logic & Reasoning | 212 |
| **Total** | **3,301** |
### Size comparison with other benchmarks
The dataset contains over 3K questions, making it suitable for training and evaluating LLMs. The following table shows the size of the dataset compared to other benchmarks:
| **Dataset** | **Number of questions** |
|--------------------------|------------------------|
| Medical School Entrance Exams | ~3,300 |
| ARC-Challenge (test) | ~1,170 |
| ARC-Easy (test) | ~2,380 |
| BoolQ (validation) | ~3,270 |
| CommonSenseQA (validation) | ~1,220 |
| GSM8K (test) | ~1,320 |
| MMLU (test) | ~14,000 |
| PIQA (validation) | ~1,850 |
| SciQ (test) | ~1,000 |
| TruthfulQA (test) | ~820 |
| WinoGrande (test) | ~1,767 |
### Format
The dataset is provided in JSONL format, with each line representing a single question in the following format:
```json
{
"id": 1691,
"topic": "biologia",
"text": "Come sono definite le cellule staminali che sono in grado di differenziarsi in tutti i tipi di cellule presenti nel corpo umano, ma non possono dare origine ad un organismo completo?",
"answers": [
"Cellule Staminali Multipotenti",
"Cellule Staminali Pluripotenti",
"Cellule Staminali Totipotenti",
"Cellule Staminali Unipotenti",
"Cellule Staminali Oligopotenti"
],
"label": 1
}
```
where:
- `id` (int): The unique identifier of the question.
- `topic` (str): The subject of the question.
- `text` (str): The text of the question.
- `answers` (list): A list of five answer choices, with one correct answer.
- `label` (int): The index of the correct answer in the `answers` list (0-indexed).
### Examples
#### Biology
```json
{
"id": 1691,
"topic": "biologia",
"text": "Come sono definite le cellule staminali che sono in grado di differenziarsi in tutti i tipi di cellule presenti nel corpo umano, ma non possono dare origine ad un organismo completo?",
"answers": [
"Cellule Staminali Multipotenti",
"Cellule Staminali Pluripotenti",
"Cellule Staminali Totipotenti",
"Cellule Staminali Unipotenti",
"Cellule Staminali Oligopotenti"
],
"label": 1
}
```
#### Chemistry
```json
{
"id": 19,
"topic": "chimica",
"text": "Rispetto alla classificazione che si trova nella tavola periodica il fluoro fa parte del: ",
"answers": [
"gruppo dei gas nobili",
"gruppo degli alogeni",
"gruppo dei lantanidi",
"secondo gruppo",
"quarto periodo"
],
"label": 1
}
```
#### Math & Physics
```json
{
"id": 1203,
"topic": "fisica-matematica",
"text": "Quali sono le coordinate del centro della circonferenza di equazione x^2 + y^2 + 2x – 6y + 5 = 0?",
"answers": [
"(2 ; –6)",
"(–2 ; 6)",
"(1 ; 3)",
"(–1 ; 3)",
"(2 ; 3)"
],
"label": 3
}
```
#### World Knowledge
```json
{
"id": 11,
"topic": "competenze-conoscenze",
"text": "Quale dei seguenti è il primo romanzo di Italo Calvino, pubblicato nel 1947?",
"answers": [
"Se una notte d'inverno un viaggiatore",
"Il barone rampante",
"Palomar",
"Le cosmicomiche",
"Il sentiero dei nidi di ragno"
],
"label": 4
}
```
#### Logic & Reasoning
```json
{
"id": 2539,
"topic": "logica",
"text": "Tutti i pasticcieri praticano il kendo; Gianluca pratica il kendo. Quale delle seguenti affermazioni aggiuntive consentirebbe di dedurre con certezza che Gianluca è un pasticciere?",
"answers": [
"Tra le persone che praticano kendo vi sono dei pasticcieri",
"Alcune persone che praticano kendo si chiamano Gianluca",
"Alcune persone che praticano kendo sono pasticcieri",
"Non è certo che ogni persona che pratica kendo sia anche un pasticciere",
"Ogni persona che pratica kendo è anche un pasticciere"
],
"label": 4
}
```
### Reproducibility
We provide the code to reproduce our dataset in the `src/data/collection` directory. The code is written in Python and uses the `beautifulsoup4` library to scrape the questions from the official MIUR website. You can run the code to collect the latest questions from the website and generate the dataset in JSONL format.
You can run the code using the following command:
```bash
python src/data/collection/collect_questions.py \
--output_path data/questions/medical_school_questions.jsonl \
--last_page_index 174
```
This command collects the questions from the official MIUR website and saves them in the `data/questions/medical_school_questions.jsonl` file. You can specify the number of pages to scrape using the `--last_page_index` argument (where each page contains 20 questions and the last page is 174).
## Citation
> [!NOTE]
> We are currently writing a report on the dataset and will provide the citation information soon.
## License
This dataset is released under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). Feel free to use it for research, commercial, or personal purposes. |