leon93 commited on
Commit
6fecb57
verified
1 Parent(s): 3480816

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +74 -45
README.md CHANGED
@@ -1,63 +1,78 @@
1
  ---
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
 
6
  # Model Card for Model ID
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
 
11
 
12
  ## Model Details
13
 
14
  ### Model Description
15
 
16
- <!-- Provide a longer summary of what this model is. -->
 
 
 
 
 
 
 
17
 
18
  This is the model card of a 馃 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
 
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
 
28
  ### Model Sources [optional]
29
 
30
  <!-- Provide the basic links for the model. -->
31
 
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
  - **Demo [optional]:** [More Information Needed]
35
 
36
  ## Uses
37
 
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
  ### Direct Use
41
 
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
 
44
- [More Information Needed]
45
 
46
  ### Downstream Use [optional]
 
47
 
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
 
50
  [More Information Needed]
51
 
52
  ### Out-of-Scope Use
53
 
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
 
56
  [More Information Needed]
57
 
58
  ## Bias, Risks, and Limitations
59
 
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
 
62
  [More Information Needed]
63
 
@@ -65,11 +80,26 @@ This is the model card of a 馃 transformers model that has been pushed on the
65
 
66
  <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
 
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
 
70
  ## How to Get Started with the Model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
- Use the code below to get started with the model.
73
 
74
  [More Information Needed]
75
 
@@ -77,38 +107,40 @@ Use the code below to get started with the model.
77
 
78
  ### Training Data
79
 
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
  [More Information Needed]
83
 
84
  ### Training Procedure
85
 
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
 
88
  #### Preprocessing [optional]
89
 
90
- [More Information Needed]
91
 
92
 
93
  #### Training Hyperparameters
94
 
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
 
97
  #### Speeds, Sizes, Times [optional]
98
 
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
 
 
100
 
101
  [More Information Needed]
102
 
103
  ## Evaluation
104
 
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
 
107
  ### Testing Data, Factors & Metrics
108
 
 
109
  #### Testing Data
110
 
111
- <!-- This should link to a Dataset Card if possible. -->
112
 
113
  [More Information Needed]
114
 
@@ -120,17 +152,15 @@ Use the code below to get started with the model.
120
 
121
  #### Metrics
122
 
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
 
129
- [More Information Needed]
130
 
131
  #### Summary
132
 
133
-
134
 
135
  ## Model Examination [optional]
136
 
@@ -154,25 +184,24 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
154
 
155
  ### Model Architecture and Objective
156
 
157
- [More Information Needed]
158
 
159
  ### Compute Infrastructure
160
 
161
- [More Information Needed]
162
 
163
- #### Hardware
164
 
165
- [More Information Needed]
166
 
 
167
  #### Software
168
 
169
- [More Information Needed]
170
 
171
  ## Citation [optional]
172
 
173
  <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
 
175
- **BibTeX:**
176
 
177
  [More Information Needed]
178
 
@@ -192,8 +221,8 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
192
 
193
  ## Model Card Authors [optional]
194
 
195
- [More Information Needed]
196
 
197
  ## Model Card Contact
198
 
199
- [More Information Needed]
 
1
  ---
2
  library_name: transformers
3
+ tags:
4
+ - biology
5
+ - medical
6
+ license: cc-by-nc-nd-4.0
7
+ datasets:
8
+ - fundacionctic/DermatES
9
+ language:
10
+ - es
11
+ metrics:
12
+ - accuracy
13
+ - f1
14
+ pipeline_tag: text-classification
15
  ---
16
 
17
  # Model Card for Model ID
18
 
19
+ This is a fine-tuned version of the pre-trained biomedical language model [bsc-bio-ehr-es](https://huggingface.co/PlanTL-GOB-ES/bsc-bio-ehr-es) in Spanish, tailored for text classification tasks. We used two NVIDIA GPUs for training.
 
20
 
21
 
22
  ## Model Details
23
 
24
  ### Model Description
25
 
26
+ This model has been fine-tuned for text classification on dermatological Spanish electronic health records (EHR). It leverages the pre-trained biomedical language understanding from the [bsc-bio-ehr-es](https://huggingface.co/PlanTL-GOB-ES/bsc-bio-ehr-es) model and adapts it to classify dermatology-related texts effectively.
27
+ The model is intended to predict among 25 different skin diseases from a medical record. It could be a first visit or a follow-up visit.
28
+ It takes as input three things:
29
+ - *textual medical record:* the EHR written by a doctor
30
+ - *disease type:* the type of disease associated with the EHR
31
+ - *disease location:* the location in the body of the disease
32
+ - *disease severity:* how severe or lethal is the disease
33
+
34
 
35
  This is the model card of a 馃 transformers model that has been pushed on the Hub. This model card has been automatically generated.
36
 
37
+ - **Developed by:** [Fundacion CTIC](https://www.fundacionctic.org)
38
+ - **Funded by [optional]:** [SATEC](https://www.satec.es)
39
+ - **Model type:** Fine-tuned LM Encoder
40
+ - **Language(s) (NLP):** Spanish
41
+ - **License:** CC-BY-NC
42
+ - **Finetuned from model [optional]:** [bsc-bio-ehr-es](https://huggingface.co/PlanTL-GOB-ES/bsc-bio-ehr-es)
 
43
 
44
  ### Model Sources [optional]
45
 
46
  <!-- Provide the basic links for the model. -->
47
 
48
+ - **Repository:**
49
+ - **Paper [optional]:** Coming soon...
50
  - **Demo [optional]:** [More Information Needed]
51
 
52
  ## Uses
53
 
54
+ The Model is meant to be used for research ONLY ! The industrial version of the model is called [predict-dermat](https://huggingface.co/fundacionctic/predict-dermat/) and is meant to predict not only the disease but also the 3 features mentionned above.
55
+ We DO NOT recommend to fine-tune this model. It is already meant to be a downstream task.
56
  ### Direct Use
57
 
58
+ This model can be directly used for classifying dermatological text data in Spanish EHRs.
59
 
 
60
 
61
  ### Downstream Use [optional]
62
+ The model can be integrated into healthcare applications for automatic classification of dermatological conditions from patient records.
63
 
 
64
 
65
  [More Information Needed]
66
 
67
  ### Out-of-Scope Use
68
 
69
+ The model is not suitable for non-medical text classification tasks or for texts in languages other than Spanish.
70
 
71
  [More Information Needed]
72
 
73
  ## Bias, Risks, and Limitations
74
 
75
+ This model is fine-tuned on a specific dataset and may not generalize well to other types of medical texts or conditions. Users should be cautious of biases in the training data that could affect the model's performance.
76
 
77
  [More Information Needed]
78
 
 
80
 
81
  <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
82
 
83
+ Users should validate the model's performance on their specific data and consider any ethical implications of deploying a machine learning model in a healthcare setting.
84
 
85
  ## How to Get Started with the Model
86
+ ```
87
+ from transformers import RobertaTokenizerFast, RobertaForSequenceClassification,
88
+
89
+ tokenizer = RobertaTokenizerFast.from_pretrained("fundacionctic/oracle-dermat")
90
+ model = RobertaForSequenceClassification.from_pretrained("fundacionctic/oracle-dermat")
91
+ ```
92
+ # Example usage
93
+ inputs = tokenizer("Ejemplo de texto dermatol贸gico".tolist(),
94
+ truncation=True,
95
+ padding='max_length',
96
+ max_length=max_length, # Replace with your desired maximum sequence length
97
+ return_tensors='pt',
98
+ return_attention_mask=True,
99
+ ))
100
+ outputs = model(input_ids, attention_mask=attention_mask)
101
+
102
 
 
103
 
104
  [More Information Needed]
105
 
 
107
 
108
  ### Training Data
109
 
110
+ The model was fine-tuned on the DermatES dataset from Fundaci贸n CTIC, which contains Spanish dermatological EHRs.
 
111
  [More Information Needed]
112
 
113
  ### Training Procedure
114
 
115
+ The training used two NVIDIA GPUs (11gb and 49gb)
116
 
117
  #### Preprocessing [optional]
118
 
119
+ Lowercased, anonymized and accents removed texts
120
 
121
 
122
  #### Training Hyperparameters
123
 
124
+ - **Training regime:** fp32
125
 
126
  #### Speeds, Sizes, Times [optional]
127
 
128
+ Epochs: 9
129
+ Batch size: 64
130
+ Learning rate: 0.0001
131
 
132
  [More Information Needed]
133
 
134
  ## Evaluation
135
 
136
+
137
 
138
  ### Testing Data, Factors & Metrics
139
 
140
+
141
  #### Testing Data
142
 
143
+ The evaluation was performed on 0.2 of the [DermatES](https://huggingface.co/datasets/fundacionctic/DermatES) dataset.
144
 
145
  [More Information Needed]
146
 
 
152
 
153
  #### Metrics
154
 
155
+ - *Accuracy:* 0.84
156
+ - *F1 Score:* 0.75
157
+ - *top-k (k=2) accuracy:* 0.92
158
+ - *top-k (k=2) f1 Score:* 0.90
 
159
 
 
160
 
161
  #### Summary
162
 
163
+ The model achieves high accuracy and F1 score on dermatological text classification, demonstrating its effectiveness for this specific medical domain.
164
 
165
  ## Model Examination [optional]
166
 
 
184
 
185
  ### Model Architecture and Objective
186
 
187
+ The model is based on the [RoBERTa](https://huggingface.co/FacebookAI/roberta-base) architecture, fine-tuned for the objective of text classification in the biomedical domain.
188
 
189
  ### Compute Infrastructure
190
 
 
191
 
 
192
 
193
+ #### Hardware
194
 
195
+ Two NVIDIA GPUs were used for the fine-tuning process.
196
  #### Software
197
 
198
+ The fine-tuning was performed using the 馃 Transformers library.
199
 
200
  ## Citation [optional]
201
 
202
  <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
203
 
204
+ **BibTeX:** Coming soon
205
 
206
  [More Information Needed]
207
 
 
221
 
222
  ## Model Card Authors [optional]
223
 
224
+ Leon-Paul Schaub Torre, Pelayo Quiros and Helena Garcia-Mieres
225
 
226
  ## Model Card Contact
227
 
228