ygorg commited on
Commit
366b0a3
·
verified ·
1 Parent(s): 3ce5822

Delete loading script

Browse files
Files changed (1) hide show
  1. FrenchMedMCQA.py +0 -138
FrenchMedMCQA.py DELETED
@@ -1,138 +0,0 @@
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
- This paper introduces FrenchMedMCQA, the first publicly available Multiple-Choice \
24
- Question Answering (MCQA) dataset in French for medical domain. It is composed of \
25
- 3,105 questions taken from real exams of the French medical specialization diploma \
26
- in pharmacy, mixing single and multiple answers. Each instance of the dataset contains \
27
- an identifier, a question, five possible answers and their manual correction(s). \
28
- We also propose first baseline models to automatically process this MCQA task in \
29
- order to report on the current performances and to highlight the difficulty of the \
30
- task. A detailed analysis of the results showed that it is necessary to have \
31
- representations adapted to the medical domain or to the MCQA task: in our case, \
32
- English specialized models yielded better results than generic French ones, even though \
33
- FrenchMedMCQA is in French. Corpus, models and tools are available online.
34
- """
35
-
36
- _HOMEPAGE = "https://frenchmedmcqa.github.io"
37
-
38
- _LICENSE = "Apache License 2.0"
39
-
40
- _URL = "https://huggingface.co/datasets/Dr-BERT/FrenchMedMCQA/resolve/main/data.zip"
41
-
42
- _CITATION = """\
43
- @unpublished{labrak:hal-03824241,
44
- TITLE = {{FrenchMedMCQA: A French Multiple-Choice Question Answering Dataset for Medical domain}},
45
- AUTHOR = {Labrak, Yanis and Bazoge, Adrien and Dufour, Richard and Daille, Béatrice and Gourraud, Pierre-Antoine and Morin, Emmanuel and Rouvier, Mickael},
46
- URL = {https://hal.archives-ouvertes.fr/hal-03824241},
47
- NOTE = {working paper or preprint},
48
- YEAR = {2022},
49
- MONTH = Oct,
50
- PDF = {https://hal.archives-ouvertes.fr/hal-03824241/file/LOUHI_2022___QA-3.pdf},
51
- HAL_ID = {hal-03824241},
52
- HAL_VERSION = {v1},
53
- }
54
- """
55
-
56
- class FrenchMedMCQA(datasets.GeneratorBasedBuilder):
57
- """FrenchMedMCQA : A French Multi-Choice Question Answering Corpus for Medical domain"""
58
-
59
- VERSION = datasets.Version("1.0.0")
60
-
61
- def _info(self):
62
-
63
- features = datasets.Features(
64
- {
65
- "id": datasets.Value("string"),
66
- "question": datasets.Value("string"),
67
- "answer_a": datasets.Value("string"),
68
- "answer_b": datasets.Value("string"),
69
- "answer_c": datasets.Value("string"),
70
- "answer_d": datasets.Value("string"),
71
- "answer_e": datasets.Value("string"),
72
- "correct_answers": datasets.Sequence(
73
- datasets.features.ClassLabel(names=["a", "b", "c", "d", "e"]),
74
- ),
75
- "type": datasets.Value("string"),
76
- "subject_name": datasets.Value("string"),
77
- "number_correct_answers": datasets.features.ClassLabel(names=["1","2","3","4","5"]),
78
- }
79
- )
80
-
81
- return datasets.DatasetInfo(
82
- description=_DESCRIPTION,
83
- features=features,
84
- homepage=_HOMEPAGE,
85
- license=_LICENSE,
86
- citation=_CITATION,
87
- )
88
-
89
- def _split_generators(self, dl_manager):
90
- """Returns SplitGenerators."""
91
-
92
- data_dir = dl_manager.download_and_extract(_URL).rstrip("/")
93
-
94
- return [
95
- datasets.SplitGenerator(
96
- name=datasets.Split.TRAIN,
97
- gen_kwargs={
98
- "filepath": data_dir + "/train.json",
99
- "split": "train",
100
- },
101
- ),
102
- datasets.SplitGenerator(
103
- name=datasets.Split.VALIDATION,
104
- gen_kwargs={
105
- "filepath": data_dir + "/dev.json",
106
- "split": "validation",
107
- },
108
- ),
109
- datasets.SplitGenerator(
110
- name=datasets.Split.TEST,
111
- gen_kwargs={
112
- "filepath": data_dir + "/test.json",
113
- "split": "test",
114
- },
115
- ),
116
- ]
117
-
118
- def _generate_examples(self, filepath, split):
119
-
120
- with open(filepath, encoding="utf-8") as f:
121
-
122
- data = json.load(f)
123
-
124
- for key, d in enumerate(data):
125
-
126
- yield key, {
127
- "id": d["id"],
128
- "question": d["question"],
129
- "answer_a": d["answers"]["a"],
130
- "answer_b": d["answers"]["b"],
131
- "answer_c": d["answers"]["c"],
132
- "answer_d": d["answers"]["d"],
133
- "answer_e": d["answers"]["e"],
134
- "correct_answers": d["correct_answers"],
135
- "number_correct_answers": str(len(d["correct_answers"])),
136
- "type": d["type"] if split != "test" else "unknown",
137
- "subject_name": d["subject_name"],
138
- }