Upload README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,130 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- es
|
4 |
+
tags:
|
5 |
+
- setfit
|
6 |
+
- sentence-transformers
|
7 |
+
- text-classification
|
8 |
+
- biomedical
|
9 |
+
- clinical
|
10 |
+
- EHR
|
11 |
+
- spanish
|
12 |
+
- location
|
13 |
+
- birth place
|
14 |
+
- residence
|
15 |
+
- movement
|
16 |
+
- medical care
|
17 |
+
license: apache-2.0
|
18 |
+
metrics:
|
19 |
+
- precision
|
20 |
+
- recall
|
21 |
+
- f1
|
22 |
+
base_model:
|
23 |
+
- BSC-NLP4BIA/SapBERT-from-roberta-base-biomedical-clinical-es
|
24 |
+
model-index:
|
25 |
+
- name: BSC-NLP4BIA/location-sub-classifier
|
26 |
+
results:
|
27 |
+
- task:
|
28 |
+
type: text-classification
|
29 |
+
dataset:
|
30 |
+
name: MEDDOPLACE (subtrack 3)
|
31 |
+
type: MEDDOPLACE
|
32 |
+
metrics:
|
33 |
+
- name: precision (micro)
|
34 |
+
type: precision
|
35 |
+
value: 0.84
|
36 |
+
- name: recall (micro)
|
37 |
+
type: recall
|
38 |
+
value: 0.83
|
39 |
+
- name: f1 (micro)
|
40 |
+
type: f1
|
41 |
+
value: 0.84
|
42 |
+
pipeline_tag: text-classification
|
43 |
+
---
|
44 |
+
|
45 |
+
|
46 |
+
# LocationSubTagger
|
47 |
+
|
48 |
+
## Table of contents
|
49 |
+
<details>
|
50 |
+
<summary>Click to expand</summary>
|
51 |
+
|
52 |
+
- [Model description](#model-description)
|
53 |
+
- [How to use](#how-to-use)
|
54 |
+
- [Limitations and bias](#limitations-and-bias)
|
55 |
+
- [Training](#training)
|
56 |
+
- [Evaluation](#evaluation)
|
57 |
+
- [Additional information](#additional-information)
|
58 |
+
- [Authors](#authors)
|
59 |
+
- [Contact information](#contact-information)
|
60 |
+
- [Licensing information](#licensing-information)
|
61 |
+
- [Funding](#funding)
|
62 |
+
- [Citing information](#citing-information)
|
63 |
+
- [Disclaimer](#disclaimer)
|
64 |
+
|
65 |
+
</details>
|
66 |
+
|
67 |
+
## Model description
|
68 |
+
|
69 |
+
This is a [SetFit model](https://github.com/huggingface/setfit) that can be used for text classification. The model has been trained using an efficient few-shot learning technique that involves:
|
70 |
+
|
71 |
+
1. Fine-tuning [BSC-NLP4BIA/SapBERT-from-roberta-base-biomedical-clinical-es](https://huggingface.co/BSC-NLP4BIA/SapBERT-from-roberta-base-biomedical-clinical-es) with contrastive learning using the [MEDDOPLACE](https://doi.org/10.5281/zenodo.7707566) corpus (subtrack 3) for subcategorization of location entities.
|
72 |
+
2. Training a classification head with features from the fine-tuned Sentence Transformer.
|
73 |
+
|
74 |
+
The labels for which this model has been trained are: brith place (LUGAR_NATAL), residence (RESIDENCIA), movement (MOVIMIENTO), medical care (ATENCION), and other (OTHER).
|
75 |
+
|
76 |
+
For further information, check the [official website](https://temu.bsc.es/meddoplace/).
|
77 |
+
|
78 |
+
## How to use
|
79 |
+
|
80 |
+
To use this model for inference, first install the SetFit library:
|
81 |
+
|
82 |
+
```bash
|
83 |
+
python -m pip install setfit
|
84 |
+
```
|
85 |
+
|
86 |
+
You can then run inference as follows:
|
87 |
+
|
88 |
+
```python
|
89 |
+
from setfit import SetFitModel
|
90 |
+
|
91 |
+
# Download from Hub and run inference
|
92 |
+
model = SetFitModel.from_pretrained("BSC-NLP4BIA/location-sub-classifier")
|
93 |
+
# Run inference
|
94 |
+
preds = model(["example1", "example2"])
|
95 |
+
```
|
96 |
+
|
97 |
+
## Limitations and bias
|
98 |
+
At the time of submission, no measures have been taken to estimate the bias embedded in the model. However, we are well aware that our models may be biased since the corpora have been collected using crawling techniques on multiple web sources. We intend to conduct research in these areas in the future, and if completed, this model card will be updated.
|
99 |
+
|
100 |
+
## Evaluation
|
101 |
+
A classification report has been generated for the MEDDOPLACE subtask3, which yields the following results:
|
102 |
+
| Category | Precision | Recall | F1-Score |
|
103 |
+
|----------------|-----------|--------|----------|
|
104 |
+
| ATENCION | 0.87 | 0.88 | 0.88 |
|
105 |
+
| LUGAR-NATAL | 0.72 | 0.79 | 0.75 |
|
106 |
+
| MOVIMIENTO | 0.82 | 0.75 | 0.78 |
|
107 |
+
| OTHER | 0.86 | 0.83 | 0.85 |
|
108 |
+
| RESIDENCIA | 0.78 | 0.84 | 0.81 |
|
109 |
+
| **accuracy** | **0.83** | | |
|
110 |
+
| **macro avg** | 0.81 | 0.82 | 0.81 |
|
111 |
+
| **micro avg** | 0.84 | 0.83 | 0.84 |
|
112 |
+
|
113 |
+
|
114 |
+
## Additional information
|
115 |
+
### Authors
|
116 |
+
NLP4BIA team at the Barcelona Supercomputing Center ([email protected]).
|
117 |
+
### Contact information
|
118 |
+
sergi.marsol [at] bsc.es
|
119 |
+
### Licensing information
|
120 |
+
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
121 |
+
### Funding
|
122 |
+
TBD
|
123 |
+
### Citing information
|
124 |
+
Please cite the following works:
|
125 |
+
### Disclaimer
|
126 |
+
The models published in this repository are intended for a generalist purpose and are available to third parties. These models may have bias and/or any other undesirable distortions.
|
127 |
+
When third parties deploy or provide systems and/or services to other parties using any of these models (or using systems based on these models) or become users of the models, they should note that it is their responsibility to mitigate the risks arising from their use and, in any event, to comply with applicable regulations, including regulations regarding the use of artificial intelligence.
|
128 |
+
---
|
129 |
+
Los modelos publicados en este repositorio tienen una finalidad generalista y están a disposición de terceros. Estos modelos pueden tener sesgos y/u otro tipo de distorsiones indeseables.
|
130 |
+
Cuando terceros desplieguen o proporcionen sistemas y/o servicios a otras partes usando alguno de estos modelos (o utilizando sistemas basados en estos modelos) o se conviertan en usuarios de los modelos, deben tener en cuenta que es su responsabilidad mitigar los riesgos derivados de su uso y, en todo caso, cumplir con la normativa aplicable, incluyendo la normativa en materia de uso de inteligencia artificial.
|