qanastek commited on
Commit
3d9c993
1 Parent(s): 85fcc1d

Upload 4 files

Browse files
Files changed (4) hide show
  1. DEFT-2023-FULL.zip +3 -0
  2. DEFT2023.py +121 -0
  3. README.md +172 -0
  4. test_dataset.py +16 -0
DEFT-2023-FULL.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:58724ce1ac97b01b89ad5a6d4d1d9b9de3379d36feaaa11058d88aad8a2af4c9
3
+ size 550466
DEFT2023.py ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ """FrenchMedMCQA : A French Multiple-Choice Question Answering Corpus for Medical domain"""
16
+
17
+ import os
18
+ import json
19
+
20
+ import datasets
21
+
22
+ _DESCRIPTION = """\
23
+ FrenchMedMCQA
24
+ """
25
+
26
+ _HOMEPAGE = "https://frenchmedmcqa.github.io"
27
+
28
+ _LICENSE = "Apache License 2.0"
29
+
30
+ _URL = "https://huggingface.co/datasets/DEFT-2023/DEFT2023/resolve/main/DEFT-2023-FULL.zip"
31
+
32
+ _CITATION = """\
33
+ @unpublished{labrak:hal-03824241,
34
+ TITLE = {{FrenchMedMCQA: A French Multiple-Choice Question Answering Dataset for Medical domain}},
35
+ AUTHOR = {Labrak, Yanis and Bazoge, Adrien and Dufour, Richard and Daille, Béatrice and Gourraud, Pierre-Antoine and Morin, Emmanuel and Rouvier, Mickael},
36
+ URL = {https://hal.archives-ouvertes.fr/hal-03824241},
37
+ NOTE = {working paper or preprint},
38
+ YEAR = {2022},
39
+ MONTH = Oct,
40
+ PDF = {https://hal.archives-ouvertes.fr/hal-03824241/file/LOUHI_2022___QA-3.pdf},
41
+ HAL_ID = {hal-03824241},
42
+ HAL_VERSION = {v1},
43
+ }
44
+ """
45
+
46
+ class DEFT2023(datasets.GeneratorBasedBuilder):
47
+ """FrenchMedMCQA : A French Multi-Choice Question Answering Corpus for Medical domain"""
48
+
49
+ VERSION = datasets.Version("1.0.0")
50
+
51
+ def _info(self):
52
+
53
+ features = datasets.Features(
54
+ {
55
+ "id": datasets.Value("string"),
56
+ "question": datasets.Value("string"),
57
+ "answer_a": datasets.Value("string"),
58
+ "answer_b": datasets.Value("string"),
59
+ "answer_c": datasets.Value("string"),
60
+ "answer_d": datasets.Value("string"),
61
+ "answer_e": datasets.Value("string"),
62
+ "correct_answers": datasets.Sequence(
63
+ datasets.features.ClassLabel(names=["a", "b", "c", "d", "e"]),
64
+ ),
65
+ "number_correct_answers": datasets.features.ClassLabel(names=["1","2","3","4","5"]),
66
+ }
67
+ )
68
+
69
+ return datasets.DatasetInfo(
70
+ description=_DESCRIPTION,
71
+ features=features,
72
+ homepage=_HOMEPAGE,
73
+ license=_LICENSE,
74
+ citation=_CITATION,
75
+ )
76
+
77
+ def _split_generators(self, dl_manager):
78
+ """Returns SplitGenerators."""
79
+
80
+ data_dir = dl_manager.download_and_extract(_URL)
81
+
82
+ return [
83
+ datasets.SplitGenerator(
84
+ name=datasets.Split.TRAIN,
85
+ gen_kwargs={
86
+ "filepath": os.path.join(data_dir, "train.json"),
87
+ },
88
+ ),
89
+ datasets.SplitGenerator(
90
+ name=datasets.Split.VALIDATION,
91
+ gen_kwargs={
92
+ "filepath": os.path.join(data_dir, "dev.json"),
93
+ },
94
+ ),
95
+ datasets.SplitGenerator(
96
+ name=datasets.Split.TEST,
97
+ gen_kwargs={
98
+ "filepath": os.path.join(data_dir, "test.json"),
99
+ },
100
+ ),
101
+ ]
102
+
103
+ def _generate_examples(self, filepath):
104
+
105
+ with open(filepath, encoding="utf-8") as f:
106
+
107
+ data = json.load(f)
108
+
109
+ for key, d in enumerate(data):
110
+
111
+ yield key, {
112
+ "id": d["id"],
113
+ "question": d["question"],
114
+ "answer_a": d["answers"]["a"],
115
+ "answer_b": d["answers"]["b"],
116
+ "answer_c": d["answers"]["c"],
117
+ "answer_d": d["answers"]["d"],
118
+ "answer_e": d["answers"]["e"],
119
+ "correct_answers": d["correct_answers"],
120
+ "number_correct_answers": str(len(d["correct_answers"])),
121
+ }
README.md ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - no-annotation
4
+ language_creators:
5
+ - expert-generated
6
+ language:
7
+ - fr
8
+ license:
9
+ - apache-2.0
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 1k<n<10k
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - question-answering
18
+ - multiple-choice
19
+ task_ids:
20
+ - multiple-choice-qa
21
+ - open-domain-qa
22
+ paperswithcode_id: frenchmedmcqa
23
+ pretty_name: FrenchMedMCQA
24
+ ---
25
+
26
+ # Dataset Card for FrenchMedMCQA : A French Multiple-Choice Question Answering Corpus for Medical domain
27
+
28
+ ## Table of Contents
29
+ - [Dataset Card for FrenchMedMCQA : A French Multiple-Choice Question Answering Corpus for Medical domain](#dataset-card-for-frenchmedmcqa--a-french-multiple-choice-question-answering-corpus-for-medical-domain)
30
+ - [Table of Contents](#table-of-contents)
31
+ - [Dataset Description](#dataset-description)
32
+ - [Dataset Summary](#dataset-summary)
33
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
34
+ - [Languages](#languages)
35
+ - [Dataset Structure](#dataset-structure)
36
+ - [Data Instances](#data-instances)
37
+ - [Data Fields](#data-fields)
38
+ - [Data Splits](#data-splits)
39
+ - [Dataset Creation](#dataset-creation)
40
+ - [Source Data](#source-data)
41
+ - [Initial Data Collection and Normalization](#initial-data-collection-and-normalization)
42
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
43
+ - [Additional Information](#additional-information)
44
+ - [Dataset Curators](#dataset-curators)
45
+ - [Licensing Information](#licensing-information)
46
+ - [Citation Information](#citation-information)
47
+ - [Contact](#contact)
48
+
49
+ ## Dataset Description
50
+
51
+ - **Homepage:** https://deft2023.univ-avignon.fr/
52
+ - **Repository:** https://deft2023.univ-avignon.fr/
53
+ - **Paper:** [FrenchMedMCQA: A French Multiple-Choice Question Answering Dataset for Medical domain](https://hal.science/hal-03824241/document)
54
+ - **Leaderboard:** Coming soon
55
+ - **Point of Contact:** [Yanis LABRAK](mailto:yanis.labrak@univ-avignon.fr)
56
+
57
+ ### Dataset Summary
58
+
59
+ This paper introduces FrenchMedMCQA, the first publicly available Multiple-Choice Question Answering (MCQA) dataset in French for medical domain. It is composed of 3,105 questions taken from real exams of the French medical specialization diploma in pharmacy, mixing single and multiple answers.
60
+
61
+ Each instance of the dataset contains an identifier, a question, five possible answers and their manual correction(s).
62
+
63
+ We also propose first baseline models to automatically process this MCQA task in order to report on the current performances and to highlight the difficulty of the task. A detailed analysis of the results showed that it is necessary to have representations adapted to the medical domain or to the MCQA task: in our case, English specialized models yielded better results than generic French ones, even though FrenchMedMCQA is in French. Corpus, models and tools are available online.
64
+
65
+ ### Supported Tasks and Leaderboards
66
+
67
+ Multiple-Choice Question Answering (MCQA)
68
+
69
+ ### Languages
70
+
71
+ The questions and answers are available in French.
72
+
73
+ ## Dataset Structure
74
+
75
+ ### Data Instances
76
+
77
+ ```json
78
+ {
79
+ "id": "1863462668476003678",
80
+ "question": "Parmi les propositions suivantes, laquelle (lesquelles) est (sont) exacte(s) ? Les chylomicrons plasmatiques :",
81
+ "answers": {
82
+ "a": "Sont plus riches en cholestérol estérifié qu'en triglycérides",
83
+ "b": "Sont synthétisés par le foie",
84
+ "c": "Contiennent de l'apolipoprotéine B48",
85
+ "d": "Contiennent de l'apolipoprotéine E",
86
+ "e": "Sont transformés par action de la lipoprotéine lipase"
87
+ },
88
+ "correct_answers": [
89
+ "c",
90
+ "d",
91
+ "e"
92
+ ],
93
+ "subject_name": "pharmacie",
94
+ "type": "multiple"
95
+ }
96
+ ```
97
+
98
+ ### Data Fields
99
+
100
+ - `id` : a string question identifier for each example
101
+ - `question` : question text (a string)
102
+ - `answer_a` : Option A
103
+ - `answer_b` : Option B
104
+ - `answer_c` : Option C
105
+ - `answer_d` : Option D
106
+ - `answer_e` : Option E
107
+ - `correct_answers` : Correct options, i.e., A, D and E
108
+ - `choice_type` ({"single", "multiple"}): Question choice type.
109
+ - "single": Single-choice question, where each choice contains a single option.
110
+ - "multiple": Multi-choice question, where each choice contains a combination of multiple options.
111
+
112
+ ### Data Splits
113
+
114
+ | # Answers | Training | Validation | Test | Total |
115
+ |:---------:|:--------:|:----------:|:----:|:-----:|
116
+ | 1 | 595 | 164 | 321 | 1,080 |
117
+ | 2 | 528 | 45 | 97 | 670 |
118
+ | 3 | 718 | 71 | 141 | 930 |
119
+ | 4 | 296 | 30 | 56 | 382 |
120
+ | 5 | 34 | 2 | 7 | 43 |
121
+ | Total | 2171 | 312 | 622 | 3,105 |
122
+
123
+ ## Dataset Creation
124
+
125
+ ### Source Data
126
+
127
+ #### Initial Data Collection and Normalization
128
+
129
+ The questions and their associated candidate answer(s) were collected from real French pharmacy exams on the remede website. Questions and answers were manually created by medical experts and used during examinations. The dataset is composed of 2,025 questions with multiple answers and 1,080 with a single one, for a total of 3,105 questions. Each instance of the dataset contains an identifier, a question, five options (labeled from A to E) and correct answer(s). The average question length is 14.17 tokens and the average answer length is 6.44 tokens. The vocabulary size is of 13k words, of which 3.8k are estimated medical domain-specific words (i.e. a word related to the medical field). We find an average of 2.49 medical domain-specific words in each question (17 % of the words) and 2 in each answer (36 % of the words). On average, a medical domain-specific word is present in 2 questions and in 8 answers.
130
+
131
+ ### Personal and Sensitive Information
132
+
133
+ The corpora is free of personal or sensitive information.
134
+
135
+ ## Additional Information
136
+
137
+ ### Dataset Curators
138
+
139
+ The dataset was created by Labrak Yanis and Bazoge Adrien and Dufour Richard and Daille Béatrice and Gourraud Pierre-Antoine and Morin Emmanuel and Rouvier Mickael.
140
+
141
+ ### Licensing Information
142
+
143
+ Apache 2.0
144
+
145
+ ### Citation Information
146
+
147
+ If you find this useful in your research, please consider citing the dataset paper :
148
+
149
+ ```latex
150
+ @inproceedings{labrak-etal-2022-frenchmedmcqa,
151
+ title = "{F}rench{M}ed{MCQA}: A {F}rench Multiple-Choice Question Answering Dataset for Medical domain",
152
+ author = "Labrak, Yanis and
153
+ Bazoge, Adrien and
154
+ Dufour, Richard and
155
+ Daille, Beatrice and
156
+ Gourraud, Pierre-Antoine and
157
+ Morin, Emmanuel and
158
+ Rouvier, Mickael",
159
+ booktitle = "Proceedings of the 13th International Workshop on Health Text Mining and Information Analysis (LOUHI)",
160
+ month = dec,
161
+ year = "2022",
162
+ address = "Abu Dhabi, United Arab Emirates (Hybrid)",
163
+ publisher = "Association for Computational Linguistics",
164
+ url = "https://aclanthology.org/2022.louhi-1.5",
165
+ pages = "41--46",
166
+ abstract = "This paper introduces FrenchMedMCQA, the first publicly available Multiple-Choice Question Answering (MCQA) dataset in French for medical domain. It is composed of 3,105 questions taken from real exams of the French medical specialization diploma in pharmacy, mixing single and multiple answers. Each instance of the dataset contains an identifier, a question, five possible answers and their manual correction(s). We also propose first baseline models to automatically process this MCQA task in order to report on the current performances and to highlight the difficulty of the task. A detailed analysis of the results showed that it is necessary to have representations adapted to the medical domain or to the MCQA task: in our case, English specialized models yielded better results than generic French ones, even though FrenchMedMCQA is in French. Corpus, models and tools are available online.",
167
+ }
168
+ ```
169
+
170
+ ### Contact
171
+
172
+ Thanks to contact [Yanis LABRAK](https://github.com/qanastek) for more information about this dataset.
test_dataset.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from datasets import load_dataset
2
+
3
+ dataset = load_dataset("DEFT2023.py")
4
+
5
+ print("#"*50)
6
+ print(dataset)
7
+ print("#"*50)
8
+ print(dataset["train"])
9
+ print("#"*50)
10
+ print(dataset["train"][0])
11
+ print("#"*50)
12
+
13
+ print(dataset["train"].features["number_correct_answers"].names)
14
+
15
+ label_list = dataset["train"].features["correct_answers"].feature.names
16
+ print(label_list)