Update model card with evaluation results and training config.
Browse files
README.md
CHANGED
|
@@ -1,95 +1,88 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
license: apache-2.0
|
| 4 |
-
base_model: distilbert/distilgpt2
|
| 5 |
tags:
|
| 6 |
-
-
|
|
|
|
|
|
|
|
|
|
| 7 |
model-index:
|
| 8 |
-
- name: clinical-field-mapper-classification
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
-
|
| 44 |
-
-
|
| 45 |
-
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
| 0.9364 | 18.0 | 1422 | 0.9989 |
|
| 72 |
-
| 0.935 | 19.0 | 1501 | 0.9984 |
|
| 73 |
-
| 0.9328 | 20.0 | 1580 | 0.9976 |
|
| 74 |
-
| 0.9305 | 21.0 | 1659 | 0.9951 |
|
| 75 |
-
| 0.9289 | 22.0 | 1738 | 0.9949 |
|
| 76 |
-
| 0.9273 | 23.0 | 1817 | 0.9966 |
|
| 77 |
-
| 0.9263 | 24.0 | 1896 | 0.9954 |
|
| 78 |
-
| 0.9256 | 25.0 | 1975 | 0.9954 |
|
| 79 |
-
| 0.9243 | 26.0 | 2054 | 0.9937 |
|
| 80 |
-
| 0.923 | 27.0 | 2133 | 0.9928 |
|
| 81 |
-
| 0.9222 | 28.0 | 2212 | 0.9938 |
|
| 82 |
-
| 0.9219 | 29.0 | 2291 | 0.9916 |
|
| 83 |
-
| 0.9209 | 30.0 | 2370 | 0.9920 |
|
| 84 |
-
| 0.9196 | 31.0 | 2449 | 0.9918 |
|
| 85 |
-
| 0.9207 | 32.0 | 2528 | 0.9923 |
|
| 86 |
-
| 0.9212 | 33.0 | 2607 | 0.9923 |
|
| 87 |
-
| 0.9195 | 34.0 | 2686 | 0.9970 |
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
### Framework versions
|
| 91 |
-
|
| 92 |
-
- Transformers 4.51.3
|
| 93 |
-
- Pytorch 2.6.0+cu124
|
| 94 |
-
- Datasets 3.5.1
|
| 95 |
-
- Tokenizers 0.21.1
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
license: apache-2.0
|
|
|
|
| 4 |
tags:
|
| 5 |
+
- healthcare
|
| 6 |
+
- column-normalization
|
| 7 |
+
- text-classification
|
| 8 |
+
- distilgpt2
|
| 9 |
model-index:
|
| 10 |
+
- name: tsilva/clinical-field-mapper-classification
|
| 11 |
+
results:
|
| 12 |
+
- task:
|
| 13 |
+
name: Field Classification
|
| 14 |
+
type: text-classification
|
| 15 |
+
dataset:
|
| 16 |
+
name: tsilva/clinical-field-mappings
|
| 17 |
+
type: healthcare
|
| 18 |
+
metrics:
|
| 19 |
+
- name: train Accuracy
|
| 20 |
+
type: accuracy
|
| 21 |
+
value: 0.9471
|
| 22 |
+
- name: validation Accuracy
|
| 23 |
+
type: accuracy
|
| 24 |
+
value: 0.9144
|
| 25 |
+
- name: test Accuracy
|
| 26 |
+
type: accuracy
|
| 27 |
+
value: 0.9156
|
| 28 |
---
|
| 29 |
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
# Model Card for tsilva/clinical-field-mapper-classification
|
| 33 |
+
|
| 34 |
+
This model is a fine-tuned version of `distilbert/distilgpt2` on the [`tsilva/clinical-field-mappings`](https://huggingface.co/datasets/tsilva/clinical-field-mappings/tree/4d4cdba1b7e9b1eff2893c7014cfc08fe58a73bc) dataset.
|
| 35 |
+
Its purpose is to normalize healthcare database column names to a standardized set of target column names.
|
| 36 |
+
|
| 37 |
+
## Task
|
| 38 |
+
|
| 39 |
+
This model is a sequence classification model that maps free-text field names to a set of standardized schema terms.
|
| 40 |
+
|
| 41 |
+
## Usage
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 45 |
+
|
| 46 |
+
tokenizer = AutoTokenizer.from_pretrained("tsilva/clinical-field-mapper-classification")
|
| 47 |
+
model = AutoModelForSequenceClassification.from_pretrained("tsilva/clinical-field-mapper-classification")
|
| 48 |
+
|
| 49 |
+
def predict(input_text):
|
| 50 |
+
inputs = tokenizer(input_text, return_tensors="pt")
|
| 51 |
+
outputs = model(**inputs)
|
| 52 |
+
pred = outputs.logits.argmax(-1).item()
|
| 53 |
+
label = model.config.id2label[str(pred)] if hasattr(model.config, 'id2label') else pred
|
| 54 |
+
print(f"Predicted label: family_history_reported")
|
| 55 |
+
|
| 56 |
+
predict('cardi@')
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
## Evaluation Results
|
| 60 |
+
|
| 61 |
+
- **train accuracy**: 94.71%
|
| 62 |
+
- **validation accuracy**: 91.44%
|
| 63 |
+
- **test accuracy**: 91.56%
|
| 64 |
+
|
| 65 |
+
## Training Details
|
| 66 |
+
|
| 67 |
+
- **Seed**: 42
|
| 68 |
+
- **Epochs scheduled**: 50
|
| 69 |
+
- **Epochs completed**: 34
|
| 70 |
+
- **Early stopping triggered**: Yes
|
| 71 |
+
- **Final training loss**: 1.0888
|
| 72 |
+
- **Final evaluation loss**: 0.9916
|
| 73 |
+
- **Optimizer**: adamw_bnb_8bit
|
| 74 |
+
- **Learning rate**: 0.0005
|
| 75 |
+
- **Batch size**: 1024
|
| 76 |
+
- **Precision**: fp16
|
| 77 |
+
- **DeepSpeed enabled**: True
|
| 78 |
+
- **Gradient accumulation steps**: 1
|
| 79 |
+
|
| 80 |
+
## License
|
| 81 |
+
|
| 82 |
+
Specify your license here (e.g., Apache 2.0, MIT, etc.)
|
| 83 |
+
|
| 84 |
+
## Limitations and Bias
|
| 85 |
+
|
| 86 |
+
- Model was trained on a specific clinical mapping dataset.
|
| 87 |
+
- Performance may vary on out-of-distribution column names.
|
| 88 |
+
- Ensure you validate model outputs in production environments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|