HiTZ
/

Text Generation
Transformers
PyTorch
Safetensors
mt5
text2text-generation
medical
multilingual
medic
Iker commited on
Commit
113080b
·
1 Parent(s): 50860b2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +285 -0
README.md CHANGED
@@ -1,3 +1,288 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ language:
4
+ - en
5
+ - es
6
+ - fr
7
+ - it
8
+ library_name: transformers
9
+ pipeline_tag: text2text-generation
10
+ tags:
11
+ - medical
12
+ - multilingual
13
+ - medic
14
  ---
15
+
16
+ <p align="center">
17
+ <br>
18
+ <img src="http://www.ixa.eus/sites/default/files/anitdote.png" style="height: 250px;">
19
+ <h2 align="center">MedMT5: An Open-Source Multilingual Text-to-Text LLM
20
+ for The Medical Domain</h2>
21
+ <br>
22
+
23
+
24
+ # Model Card for MedMT5-large
25
+
26
+ <p align="justify">
27
+ We present MedMT5, the first open-source text-to-text multilingual model for the medical domain. MedMT5 is an encoder-decoder model developed by continuing the training of publicly available mT5 checkpoints on medical domain data for English, Spanish, French, and Italian.
28
+ </p>
29
+ - 📖 Paper: ** Coming soon **
30
+
31
+
32
+ <table border="1" cellspacing="0" cellpadding="5">
33
+ <caption>Pre-Training settings for MedMT5.</caption>
34
+ <thead>
35
+ <tr>
36
+ <th></th>
37
+ <th>MedMT5-Large (<a href="https://huggingface.co/HiTZ/MedMT5-large">HiTZ/MedMT5-large</a>)</th>
38
+ <th>MedMT5-XL (<a href="https://huggingface.co/HiTZ/MedMT5-xl">HiTZ/MedMT5-xl</a>)</th>
39
+ </tr>
40
+ </thead>
41
+ <tbody>
42
+ <tr>
43
+ <td>Param. no.</td>
44
+ <td>738M</td>
45
+ <td>3B</td>
46
+ </tr>
47
+ <tr>
48
+ <td>Sequence Length</td>
49
+ <td>1024</td>
50
+ <td>480</td>
51
+ </tr>
52
+ <tr>
53
+ <td>Token/step</td>
54
+ <td>65536</td>
55
+ <td>30720</td>
56
+ </tr>
57
+ <tr>
58
+ <td>Epochs</td>
59
+ <td>1</td>
60
+ <td>1</td>
61
+ </tr>
62
+ <tr>
63
+ <td>Total Tokens</td>
64
+ <td>4.5B</td>
65
+ <td>4.5B</td>
66
+ </tr>
67
+ <tr>
68
+ <td>Optimizer</td>
69
+ <td>Adafactor</td>
70
+ <td>Adafactor</td>
71
+ </tr>
72
+ <tr>
73
+ <td>LR</td>
74
+ <td>0.001</td>
75
+ <td>0.001</td>
76
+ </tr>
77
+ <tr>
78
+ <td>Scheduler</td>
79
+ <td>Constant</td>
80
+ <td>Constant</td>
81
+ </tr>
82
+ <tr>
83
+ <td>Hardware</td>
84
+ <td>4xA100</td>
85
+ <td>4xA100</td>
86
+ </tr>
87
+ <tr>
88
+ <td>Time (h)</td>
89
+ <td>10.5</td>
90
+ <td>20.5</td>
91
+ </tr>
92
+ <tr>
93
+ <td>CO<sub>2</sub>eq (kg)</td>
94
+ <td>2.9</td>
95
+ <td>5.6</td>
96
+ </tr>
97
+ </tbody>
98
+ </table>
99
+
100
+
101
+ # Model Description
102
+
103
+ - **Developed by**: Iker García-Ferrero, Rodrigo Agerri, Aitziber Atutxa Salazar, Elena Cabrio, Iker de la Iglesia, Alberto Lavelli, Bernardo Magnini, Benjamin Molinet, Johana Ramirez-Romero, German Rigau, Jose Maria Villa-Gonzalez, Serena Villata and Andrea Zaninello
104
+ - **Contact**: [Iker García-Ferrero](https://ikergarcia1996.github.io/Iker-Garcia-Ferrero/)
105
+ - **Funding**: Antidote (PCI2020-120717-2) funded by MCIN/AEI /10.13039/501100011033 and by European Union NextGenerationEU/PRTR
106
+ - **Model type**: text2text-generation
107
+ - **Language(s) (NLP)**: English, Spanish, French, Italian
108
+ - **License**: apache-2.0
109
+ - **Finetuned from model**: MT5
110
+
111
+ ## How to Get Started with the Model
112
+
113
+ You can load the model using
114
+
115
+ ```python
116
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
117
+
118
+ tokenizer = AutoTokenizer.from_pretrained("HiTZ/MedMT5-large")
119
+ model = AutoModelForSeq2SeqLM.from_pretrained("HiTZ/MedMT5-large")
120
+ ```
121
+
122
+ The model has been trained using the T5 masked language modeling tasks. You need to finetune the model for your task.
123
+
124
+ <p align="center">
125
+ <br>
126
+ <img src="https://miro.medium.com/v2/0*yeXSc6Qs-SGKDzZP.png" style="height: 250px;">
127
+ <br>
128
+
129
+ ### MedMT5 for Sequence Labelling
130
+
131
+ If you want to use MedMT5 for Sequence Labeling, we recommend you use this code: https://github.com/ikergarcia1996/Sequence-Labeling-LLMs
132
+
133
+ ## Training Data
134
+
135
+
136
+ <table border="1" cellspacing="0" cellpadding="5">
137
+ <caption>Data sources and word counts by language.</caption>
138
+ <thead>
139
+ <tr>
140
+ <th>Language</th>
141
+ <th>Source</th>
142
+ <th>Words</th>
143
+ </tr>
144
+ </thead>
145
+ <tbody>
146
+ <tr>
147
+ <td rowspan="3">English</td>
148
+ <td>ClinicalTrials</td>
149
+ <td>127.4M</td>
150
+ </tr>
151
+ <tr>
152
+ <td>EMEA</td>
153
+ <td>12M</td>
154
+ </tr>
155
+ <tr>
156
+ <td>PubMed</td>
157
+ <td>968.4M</td>
158
+ </tr>
159
+ <tr>
160
+ <td rowspan="6">Spanish</td>
161
+ <td>EMEA</td>
162
+ <td>13.6M</td>
163
+ </tr>
164
+ <tr>
165
+ <td>PubMed</td>
166
+ <td>8.4M</td>
167
+ </tr>
168
+ <tr>
169
+ <td>Medical Crawler</td>
170
+ <td>918M</td>
171
+ </tr>
172
+ <tr>
173
+ <td>SPACC</td>
174
+ <td>350K</td>
175
+ </tr>
176
+ <tr>
177
+ <td>UFAL</td>
178
+ <td>10.5M</td>
179
+ </tr>
180
+ <tr>
181
+ <td>WikiMed</td>
182
+ <td>5.2M</td>
183
+ </tr>
184
+ <tr>
185
+ <td rowspan="5">French</td>
186
+ <td>PubMed</td>
187
+ <td>1.4M</td>
188
+ </tr>
189
+ <tr>
190
+ <td>Science Direct</td>
191
+ <td>15.2M</td>
192
+ </tr>
193
+ <tr>
194
+ <td>Wikipedia - Médecine</td>
195
+ <td>5M</td>
196
+ </tr>
197
+ <tr>
198
+ <td>EDP</td>
199
+ <td>48K</td>
200
+ </tr>
201
+ <tr>
202
+ <td>Google Patents</td>
203
+ <td>654M</td>
204
+ </tr>
205
+ <tr>
206
+ <td rowspan="13">Italian</td>
207
+ <td>Medical Commoncrawl - IT</td>
208
+ <td>67M</td>
209
+ </tr>
210
+ <tr>
211
+ <td>Drug instructions</td>
212
+ <td>30.5M</td>
213
+ </tr>
214
+ <tr>
215
+ <td>Wikipedia - Medicina</td>
216
+ <td>13.3M</td>
217
+ </tr>
218
+ <tr>
219
+ <td>E3C Corpus - IT</td>
220
+ <td>11.6M</td>
221
+ </tr>
222
+ <tr>
223
+ <td>Medicine descriptions</td>
224
+ <td>6.3M</td>
225
+ </tr>
226
+ <tr>
227
+ <td>Medical theses</td>
228
+ <td>5.8M</td>
229
+ </tr>
230
+ <tr>
231
+ <td>Medical websites</td>
232
+ <td>4M</td>
233
+ </tr>
234
+ <tr>
235
+ <td>PubMed</td>
236
+ <td>2.3M</td>
237
+ </tr>
238
+ <tr>
239
+ <td>Supplement description</td>
240
+ <td>1.3M</td>
241
+ </tr>
242
+ <tr>
243
+ <td>Medical notes</td>
244
+ <td>975K</td>
245
+ </tr>
246
+ <tr>
247
+ <td>Pathologies</td>
248
+ <td>157K</td>
249
+ </tr>
250
+ <tr>
251
+ <td>Medical test simulations</td>
252
+ <td>26K</td>
253
+ </tr>
254
+ <tr>
255
+ <td>Clinical cases</td>
256
+ <td>20K</td>
257
+ </tr>
258
+ </tbody>
259
+ </table>
260
+
261
+
262
+
263
+
264
+ ## Evaluation
265
+
266
+ ### Single-task supervised F1 scores for Sequence Labelling
267
+ <p align="center">
268
+ <br>
269
+ <img src="https://huggingface.co/HiTZ/MedMT5-large/resolve/main/single.png" style="height: 600px;">
270
+ <br>
271
+
272
+ ### Multi-task supervised F1 scores for Sequence Labelling
273
+ <p align="center">
274
+ <br>
275
+ <img src="https://huggingface.co/HiTZ/MedMT5-large/resolve/main/multi.png" style="height: 600px;">
276
+ <br>
277
+
278
+ ### Zero-shot F1 scores for Argument Mining. Models have been trained in English and evaluated in Spanish, French and Italian.
279
+ <p align="center">
280
+ <br>
281
+ <img src="https://huggingface.co/HiTZ/MedMT5-large/resolve/main/cross.png" style="height: 320px;">
282
+ <br>
283
+
284
+
285
+ ## Ethical Statement
286
+ <p align="justify">
287
+ Our research in developing MedMT5, a multilingual text-to-text model for the medical domain, has ethical implications that we acknowledge. Firstly, the broader impact of this work lies in its potential to improve medical communication and understanding across languages, which can enhance healthcare access and quality for diverse linguistic communities. However, it also raises ethical considerations related to privacy and data security. To create our multilingual corpus, we have taken measures to anonymize and protect sensitive patient information, adhering to data protection regulations in each language's jurisdiction or deriving our data from sources that explicitly address this issue in line with privacy and safety regulations and guidelines. Furthermore, we are committed to transparency and fairness in our model's development and evaluation. We have worked to ensure that our benchmarks are representative and unbiased, and we will continue to monitor and address any potential biases in the future. Finally, we emphasize our commitment to open source by making our data, code, and models publicly available, with the aim of promoting collaboration within the research community.
288
+ </p>