language:
- es
- en
license: apache-2.0
dataset_info:
features:
- name: raw_text
dtype: string
- name: topic
dtype: string
- name: speciallity
dtype: string
- name: raw_text_type
dtype: string
- name: topic_type
dtype: string
- name: source
dtype: string
- name: country
dtype: string
- name: document_id
dtype: string
splits:
- name: train
num_bytes: 190710909
num_examples: 2136490
download_size: 48472707
dataset_size: 190710909
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
task_categories:
- question-answering
- zero-shot-classification
- text-generation
pretty_name: SMC
Dataset Card for Spanish Medical Corpus (SMC)
This dataset groups and organizes several datasets present in hugginface (e.g.: PlanTL-GOB-ES/cantemist-ner, PlanTL-GOB-ES/pharmaconer) and other public resources created by researchers with different formats (e.g.; MedLexSp ) to allow it to be a source of knowledge of large language models in Spanish for the medical domain.
Dataset Details
Dataset Description
- Curated by: Dionis López Ramos, Alvaro Garcia Barragan, Dylan Montoya, Daniel Bermúdez
- Funded by: SomosNLP, HuggingFace, Argilla, Universidad de Oriente (Cuba)
- Language(s) (NLP): Spanish (
es-ES
,es-CL
) - License: apache-2.0
Dataset Sources
- Repository: somosnlp/SMC
- Paper: "Comming soon!"
- Demo: somosnlp/SMC/viewer
- Video presentation: SpanishMedicaLLM | Proyecto Hackathon #SomosNLP
Uses
The use of this dataset is suggested to achieve self-tuning and pre-training of LLM for the medical domain with information in Spanish.
Direct Use
Fine Tuning an LLM instruction in Spanish language with question prompts and answers.
Out-of-Scope Use
The creators of the dataset are not responsible for harmful results that the models may generate when trained with this information. A rigorous evaluation process with specialists of the results generated by trained LLM models is suggested.
Dataset Structure
For each entry or document in the information source, organize it in a Hugginface dataset as follows:
- question (raw_text): Text associated with the document, question, clinical case or other type of information.
- answer (topic): (Text associated with medical treatment (healthcare_treatment), diagnosis (healthcare_diagnosis), health topic (topic), answer to a question (answer), other, or be empty e.g. in the open text)
- speciality: (Medical specialty to which the raw_text relates, e.g. cardiology, surgery, others)
- raw_text_type: (Can be clinic_case, open_text, question or empty)
- topic_type: (It can be medical topic, medical diagnosis, answer, natural medicine topic, other, or empty)
- source: Identifier of the source associated with the document that appears in the README and description of the dataset.
- country: Identifier of the country of origin of the source (e.g.; ch, es) using the ISO 3166-1 alpha-2 standard (Two-letter country codes).
- document_id: Document identifier in the source dataset, this value can be empty in case it is not known.
At the beginning of this construction process, the table in the Source Data section must be updated. description of the source of information with the following data:
- Id: This will be a number so that the source of information can be referenced in each entry of the data set.
- Name: Name of the source from which it comes.
- Tokens: Number of tokens it contains.
- Memory: Memory size of the dataset generated for huggingface
- Licencia: In this case, if it is only for research or if you have another license such as MIT, Apache 2 or others
- Address: URL from where the information can be downloaded or consulted.
- Country: Information source country of the using the ISO 3166-1 standard alpha-2 code: 2-letter ISO code assigned to that country or territory.
Dataset Creation
Curation Rationale
More than 600 million Spanish speakers need resources, such as LLMs, to obtain medical information freely and safe, complying with the millennium objectives: Health and Wellbeing, Education and Quality, End of Poverty proposed by the UN. There are few resources or data sets from the medical domain for training or self-tuning for an LLM in the Spanish language.
To train an LLM autotuner in the domain of medicine and healthcare, a large amount of data from this context is needed. To create a data set in the medical domain, some certification by specialists in corpus construction is necessary.
Source Data
Id | Name | Tokens | Memory | Licencia | Address | Country |
---|---|---|---|---|---|---|
1 | Cantemist corpus: gold standard of oncology clinical cases annotated with CIE-O 3 terminology | 349287 | 9157 kB | CC Attribution 4.0 International | https://huggingface.co/datasets/bigbio/cantemist/viewer/cantemist_bigbio_kb | es |
2 | MedlinePlus Spanish (National Library of Medicine, NLM) | 7757337 | 35 MB | https://medlineplus.gov/spanish/ | es | |
3 | PharmaCoNER | 275955 | 2 MB | CC Attribution 4.0 International | https://huggingface.co/datasets/PlanTL-GOB-ES/pharmaconer | es |
4 | Spanish Biomedical Crawled Corpus | 1973048 | 264 MB | cc-by-4.0 | https://zenodo.org/records/5513237 | es |
5 | CARES | 322353 | 1828 kB | Afl-3.0 | https://huggingface.co/datasets/chizhikchi/CARES | es |
6 | MEDDOCAN | 364462 | 1639 kB | cc-by-4.0 | https://huggingface.co/datasets/bigbio/meddocan | es |
7 | Alvaro8gb/enfermedades-wiki-marzo-2024 | 1424685 | 9073 kB | MIT | https://huggingface.co/datasets/Alvaro8gb/enfermedades-wiki-marzo-2024 | es |
8 | BioMistral/BioInstructQA(spanish) | 1072476 | 5963 kB | Apache 2.0 | https://huggingface.co/datasets/BioMistral/BioInstructQA | ca |
9 | DisTEMIST | 550203 | 2754 kB | cc-by-4.0 | https://huggingface.co/datasets/bigbio/distemist | es |
10 | The Chilean Waiting List Corpus | 678934 | 3116 kB | cc-by-4.0 | https://zenodo.org/records/5518225 or https://huggingface.co/plncmm | cl |
11 | BARR2 | 1732432 | 8472 kB | cc-by-4.0 | https://temu.bsc.es/BARR2/downloads/background_set.raw_text.tar.bz2 | es |
12 | SPACC | 551849 | 2711 kB | cc-by-4.0 | https://zenodo.org/records/2560316 | es |
13 | MedLexSp | 608374 | 21 MByte | MedLexSp is distributed freely for research or educational purposes. You need to sign an agreement with the authors for other purposes. | https://digital.csic.es/handle/10261/270429 | es |
Data Collection and Processing
- Cantemist corpus
- MedlinePlus Spanish (National Library of Medicine
- PharmaCoNER
- Spanish Biomedical Crawled Corpus
- CARES
- MEDDOCAN
- Alvaro8gb/enfermedades-wiki-marzo-2024
- BioMistral/BioInstructQA(spanish)
- DisTEMIST
- The Chilean Waiting List Corpus
- BARR2
- SPACC
- MedLexSp
Sugerencias:
- In BioMistral/BioInstructQA the information was used in Spanish. For more information consult the article BioMistral: A Collection of Open-Source Pretrained Large Language Models for Medical Domains.
- In Cantemist a search was made for the code associated with the pathology and it was established as a topic.
- In CARES the associated type was searched in the established code table.
Who are the source data producers?
Different events, NLP competitions or the construction of data sets for LLM such as BioMistral. See table in Source Data section
Annotation process
The annotation process was automatic, converting the data sources to the attributes of the new data set.
Who are the annotators?
See the section Team
Personal and Sensitive Information
In the construction process, it was taken into account that sensitive user data was not included in any of the cases (e.g., clinical cases).
Bias, Risks, and Limitations
It is suggested to take into account the scope of the license of each of the sources (e.g., review the source and License field in the previous table).
If you need to filter by data source or other criteria, you can use the properties of the Dataset
data structure of the framework.
Hugginface. In the following code example, the entries that have a topic type about medical diagnosis or a medical topic are obtained from the data set:
spanishMedicaLllmDataset =
load_dataset(SPANISH_MEDICA_LLM_DATASET, split="train")
spanishMedicaLllmDataset =
spanishMedicaLllmDataset.filter(lambda example: example["topic_type"] in ['medical_diagnostic' | 'medical_topic'])
Recommendations
Personnel using this dataset must be aware of the risks, biases and limitations of the dataset.
For the autotuning of an LLM, it is suggested to take into account the rows where the topic type (ed., topic_type field) has values: medical_topic
,
medical_diagnostic
, answer
, natural_medicine_topic
. Because it indicates that this field is not empty and has value for the creation of instructions of the
question and answer form.
For LLM pre-training, it is suggested to take into account when the raw_text_type
field is equal to open_text
. This indicates that the text
is not part of a question/answer format but has important value for LLM pre-training.
License
Apache License 2.0
Citation
BibTeX:
@software{lopez2024spanishmedicallm,
author = {Lopez Dionis, Garcia Alvaro, Montoya Dylan, Bermúdez Daniel},
title = {SpanishMedicaLLM},
month = February,
year = 2024,
url = {https://huggingface.co/datasets/HuggingFaceTB/cosmopedia}
}
More Information
This project was developed during the Hackathon #Somos600M organized by SomosNLP. The dataset was created using distilabel
by Argilla and endpoints sponsored by HuggingFace.
Team:
Contact
For any doubt or suggestion contact to: PhD Dionis López (inoid2007@gmail.com)