SMC / README.md
mariagrandury's picture
Fix citation url
92ad748 verified
---
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
---
<!-- ###################################################################################################################### --->
<!--
Esta plantilla de Dataset Card es una adaptación de la de Hugging Face: https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/datasetcard_template.md
¿Cómo utilizar esta plantilla? Copia el contenido en el README.md del repo de tu dataset en el Hub de Hugging Face y rellena cada sección.
Para más información sobre cómo rellenar cada sección ver las docs: https://huggingface.co/docs/hub/datasets-cards y https://huggingface.co/docs/datasets/dataset_card
Para más información sobre la dataset card metadata ver: https://github.com/huggingface/hub-docs/blob/main/datasetcard.md?plain=1
-->
# Dataset Card for Spanish Medical Corpus (SMC)
<!-- Suele haber un nombre corto ("pretty name") para las URLs, tablas y demás y uno largo más descriptivo. Para crear el pretty name podéis utilizar acrónimos. -->
<!-- Resumen del corpus y motivación del proyecto (inc. los ODS relacionados). Esta sección es como el abstract. También se puede incluir aquí el logo del proyecto. -->
<!-- Si queréis incluir una versión de la Dataset Card en español, enlazarla aquí al principio (e.g. `README_es.md`).-->
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.
<!--
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 Card in Spanish**](README_es.md)
## Dataset Details
### Dataset Description
<!-- Resumen del dataset. -->
- **Curated by:** [Dionis López Ramos](https://www.linkedin.com/in/dionis-lopez-ramos/), [Alvaro Garcia Barragan](https://huggingface.co/Alvaro8gb), [Dylan Montoya](https://huggingface.co/dylanmontoya22), [Daniel Bermúdez](https://huggingface.co/Danielbrdz) <!-- Nombre de los miembros del equipo -->
- **Funded by:** SomosNLP, HuggingFace, Argilla, Universidad de Oriente (Cuba) <!-- Si contasteis con apoyo de otra entidad (e.g. vuestra universidad), añadidla aquí -->
- **Language(s) (NLP):** Spanish (`es-ES`, `es-CL`) <!-- Enumerar las lenguas en las que se ha entrenado el modelo, especificando el país de origen. Utilizar códigos ISO. Por ejemplo: Spanish (`es-CL`, `es-ES`, `es-MX`), Catalan (`ca`), Quechua (`qu`). -->
- **License:** apache-2.0 <!-- Elegid una licencia lo más permisiva posible teniendo en cuenta la licencia del model pre-entrenado y los datasets utilizados -->
### Dataset Sources
- **Repository:** [somosnlp/SMC](https://huggingface.co/datasets/somosnlp/SMC/tree/main)
- **Paper:** "Comming soon!" <!-- Si vais a presentarlo a NAACL poned "WIP", "Comming soon!" o similar. Si no tenéis intención de presentarlo a ninguna conferencia ni escribir un preprint, eliminar. -->
- **Demo:** [somosnlp/SMC/viewer](https://huggingface.co/datasets/somosnlp/SMC/viewer)
- **Video presentation:** [ SpanishMedicaLLM | Proyecto Hackathon #SomosNLP ](https://www.youtube.com/watch?v=tVe_MC7Da6k) <!-- Enlace a vuestro vídeo de presentación en YouTube (están todos subidos aquí: https://www.youtube.com/playlist?list=PLTA-KAy8nxaASMwEUWkkTfMaDxWBxn-8J) -->
## Uses
<!-- Address questions around how the dataset is intended to be used. -->
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
<!-- This section describes suitable use cases for the dataset. -->
Fine Tuning an LLM instruction in Spanish language with question prompts and answers.
### Out-of-Scope Use
<!-- This section addresses misuse, malicious use, and uses that the dataset will not work well for. -->
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
<!-- This section provides a description of the dataset fields, and additional information about the dataset structure such as criteria used to create the splits, relationships between data points, etc. -->
<!-- En esta sección podéis enumerar y explicar cada columna del corpus. Para cada columna que sea de tipo "categoría" podéis indicar el porcentaje de ejemplos. -->
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.
<!-- - **idioma**: (Variedad geográfica) código ISO del idioma -->
<!--- **registro** (Variedad funcional): Siempre es `medio`. -->
<!-- - **periodo** (Variedad histórica): Siempre es `actual`. -->
<!-- - **dominio**: salud (clínico, biomédico, farmacia). -->
<!-- - **tarea**: `pregunta` | `resumen` | `open_text` | `clinic_case`. -->
<!-- - **país_origen**: País de origen de los datos. -->
At the beginning of this construction process, the table in the [Source Data](#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](https://es.wikipedia.org/wiki/ISO_3166-1) alpha-2 code: 2-letter ISO code assigned to that country or territory.
## Dataset Creation
### Curation Rationale
<!-- Motivation for the creation of this dataset. -->
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 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
<!-- This section describes the source data (e.g. news text and headlines, social media posts, translated sentences, ...). -->
| 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://creativecommons.org/licenses/by/4.0/) | 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://creativecommons.org/licenses/by/4.0/) | 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://choosealicense.com/licenses/mit/) | https://huggingface.co/datasets/Alvaro8gb/enfermedades-wiki-marzo-2024 | es |
| 8 | BioMistral/BioInstructQA(**spanish**) | 1072476 | 5963 kB | [Apache 2.0](https://choosealicense.com/licenses/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
<!-- This section describes the data collection and processing process such as data selection criteria, filtering and normalization methods, tools and libraries used, etc. -->
<!-- Enlazar aquí los scripts y notebooks utilizados para generar el corpus. -->
- [Cantemist corpus](./catemist)
- [MedlinePlus Spanish (National Library of Medicine)](./medlineplus_spanish)
- [PharmaCoNER](./pharmaconer)
- [Spanish Biomedical Crawled Corpus](./spanish_biomedical_craw_corpus)
- [CARES](./cares)
- [MEDDOCAN](./meddocan)
- [Alvaro8gb/enfermedades-wiki-marzo-2024](./wikipedia_datasets)
- [BioMistral/BioInstructQA(**spanish**)](./spanish_biomedical_craw_corpus)
- [DisTEMIST](./distemist)
- [The Chilean Waiting List Corpus](./chileancaselist)
- [BARR2](./barr2)
- [SPACC](./spaccc)
- [MedLexSp](./medlexsp)
**Sugerencias:**
- In [BioMistral/BioInstructQA](https://huggingface.co/datasets/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](https://arxiv.org/pdf/2402.10373.pdf?trk=public_post_comment-text).
- In [Cantemist](https://huggingface.co/datasets/bigbio/cantemist/viewer/cantemist_bigbio_kb) a search was made for the code associated with the pathology and it was established as a topic.
- In [CARES](https://huggingface.co/datasets/chizhikchi/CARES) the associated type was searched in the established code table.
#### Who are the source data producers?
<!-- This section describes the people or systems who originally created the data. It should also include self-reported demographic or identity information for the source data creators if this information is available. -->
Different events, NLP competitions or the construction of data sets for LLM such as BioMistral. See [table in Source Data section](#Source)
#### Annotation process
<!-- This section describes the annotation process such as annotation tools used in the process, the amount of data annotated, annotation guidelines provided to the annotators, interannotator statistics, annotation validation, etc. -->
<!-- Enlazar aquí el notebook utilizado para crear el espacio de anotación de Argilla y la guía de anotación. -->
The annotation process was automatic, converting the data sources to the attributes of the new data set.
#### Who are the annotators?
<!-- This section describes the people or systems who created the annotations. -->
See the section [Team](#Team)
#### Personal and Sensitive Information
<!-- State whether the dataset contains data that might be considered personal, sensitive, or private (e.g., data that reveals addresses, uniquely identifiable names or aliases, racial or ethnic origins, sexual orientations, religious beliefs, political opinions, financial or health data, etc.). If efforts were made to anonymize the data, describe the anonymization process. -->
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).
<!-- 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
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
<!-- Aquí podéis mencionar los posibles sesgos heredados según el origen de los datos y de las personas que lo han anotado, hablar del balance de las categorías representadas, los esfuerzos que habéis hecho para intentar mitigar sesgos y riesgos. -->
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
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations.
Example:
Users should be made aware of the risks, biases and limitations of the dataset. More information needed for further 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.
<!--
In case of using this dataset for the LLM training or finetuning for natural language generating with a production
environment target, we do not recommend the use of these results without a rigorous medical
specialists evaluation and evaluation with higth performances values.
-->
## License
<!-- Indicar bajo qué licencia se libera el dataset explicando, si no es apache 2.0, a qué se debe la licencia más restrictiva (i.e. herencia de los datos utilizados). -->
Apache License 2.0
## Citation
<!-- If there is a paper or blog post introducing the dataset, the APA and Bibtex information for that should go in this section. -->
**BibTeX:**
```
@software{lopez2024spanishmedicallm,
author = {Lopez Dionis, Garcia Alvaro, Montoya Dylan, Bermúdez Daniel},
title = {SpanishMedicaLLM},
month = February,
year = 2024,
url = {https://huggingface.co/datasets/somosnlp/SMC}
}
```
<!--
Aquí tenéis un ejemplo de cita de un dataset que podéis adaptar:
```
@software{benallal2024cosmopedia,
author = {Ben Allal, Loubna and Lozhkov, Anton and Penedo, Guilherme and Wolf, Thomas and von Werra, Leandro},
title = {Cosmopedia},
month = February,
year = 2024,
url = {https://huggingface.co/datasets/HuggingFaceTB/cosmopedia}
}
```
- benallal2024cosmopedia -> nombre + año + nombre del dataset
- author: lista de miembros del equipo
- title: nombre del dataset
- year: año
- url: enlace al dataset
-->
## More Information
<!-- Indicar aquí que el marco en el que se desarrolló el proyecto, en esta sección podéis incluir agradecimientos y más información sobre los miembros del equipo. Podéis adaptar el ejemplo a vuestro gusto. -->
This project was developed during the [Hackathon #Somos600M](https://somosnlp.org/hackathon) organized by SomosNLP. The dataset was created using `distilabel` by Argilla and endpoints sponsored by HuggingFace.
**Team:**
<!--
- [Name 1](Link to Hugging Face profile)
- [Name 2](Link to Hugging Face profile)
-->
- [Dionis López Ramos](https://huggingface.co/inoid)
- [Alvaro Garcia Barragan](https://huggingface.co/Alvaro8gb)
- [Dylan Montoya](https://huggingface.co/dylanmontoya22)
- [Daniel Bermúdez](https://huggingface.co/Danielbrdz)
## Contact
For any doubt or suggestion contact to: PhD Dionis López (inoid2007@gmail.com)