Upload folder using huggingface_hub
Browse files- README.md +66 -0
- best_hyperparameters.json +7 -0
- config.json +32 -0
- model.safetensors +3 -0
- performance_report.json +221 -0
- performance_report.md +72 -0
- rng_state.pth +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +58 -0
- trainer_state.json +162 -0
- vocab.txt +0 -0
README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
task: token-classification
|
| 3 |
+
tags:
|
| 4 |
+
- biomedical
|
| 5 |
+
- bionlp
|
| 6 |
+
license: mit
|
| 7 |
+
base_model: microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# bioner_ncbi_disease
|
| 11 |
+
|
| 12 |
+
This is a named entity recognition model fine-tuned from the [microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext](https://huggingface.co/microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext) model. It predicts spans with 2 possible labels. The labels are **DiseaseClass and SpecificDisease**.
|
| 13 |
+
|
| 14 |
+
The code used for training this model can be found at https://github.com/Glasgow-AI4BioMed/bioner along with links to other biomedical NER models trained on well-known biomedical corpora. The source dataset information is below.
|
| 15 |
+
|
| 16 |
+
## Example Usage
|
| 17 |
+
|
| 18 |
+
The code below will load up the model and apply it to the provided text. It uses a simple aggregation strategy to post-process the individual tokens into larger multi-token entities where needed.
|
| 19 |
+
|
| 20 |
+
```python
|
| 21 |
+
from transformers import pipeline
|
| 22 |
+
|
| 23 |
+
# Load the model as part of an NER pipeline
|
| 24 |
+
ner_pipeline = pipeline("token-classification",
|
| 25 |
+
model="Glasgow-AI4BioMed/bioner_ncbi_disease",
|
| 26 |
+
aggregation_strategy="max")
|
| 27 |
+
|
| 28 |
+
# Apply it to some text
|
| 29 |
+
ner_pipeline("EGFR T790M mutations have been known to affect treatment outcomes for NSCLC patients receiving erlotinib.")
|
| 30 |
+
|
| 31 |
+
# Output:
|
| 32 |
+
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
## Dataset Info
|
| 36 |
+
|
| 37 |
+
**Source:** The NCBI Disease dataset was downloaded from: https://www.ncbi.nlm.nih.gov/CBBresearch/Dogan/DISEASE/
|
| 38 |
+
|
| 39 |
+
The dataset should be cited with: Doğan, Rezarta Islamaj, Robert Leaman, and Zhiyong Lu. "NCBI disease corpus: a resource for disease name recognition and concept normalization." Journal of biomedical informatics 47 (2014): 1-10. DOI: [10.1016/j.jbi.2013.12.006](https://doi.org/10.1016/j.jbi.2013.12.006)
|
| 40 |
+
|
| 41 |
+
**Preprocessing:** The training/validation/test split was maintained from the original dataset. The annotations were filtered down to only 'DiseaseClass' and 'SpecificDisease'. The preprocessing script for this dataset is [prepare_ncbi_disease.py](https://github.com/Glasgow-AI4BioMed/bioner/blob/main/prepare_ncbi_disease.py).
|
| 42 |
+
|
| 43 |
+
## Performance
|
| 44 |
+
|
| 45 |
+
The span-level performance on the test split for the different labels are shown in the tables below. The full performance results are available in the model repo in Markdown format for viewing and JSON format for easier loading. These include the performance at token level (with individual B- and I- labels as the token classifier uses IOB2 token labelling).
|
| 46 |
+
|
| 47 |
+
| Label | Precision | Recall | F1-score | Support |
|
| 48 |
+
| --- | --- | --- | --- | --- |
|
| 49 |
+
| DiseaseClass | 0.592 | 0.769 | 0.669 | 121 |
|
| 50 |
+
| SpecificDisease | 0.816 | 0.809 | 0.813 | 555 |
|
| 51 |
+
| macro avg | 0.704 | 0.789 | 0.741 | 676 |
|
| 52 |
+
| weighted avg | 0.776 | 0.802 | 0.787 | 676 |
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
## Hyperparameters
|
| 56 |
+
|
| 57 |
+
Hyperparameter tuning was done with [optuna](https://optuna.org/) and the [hyperparameter_search](https://huggingface.co/docs/transformers/en/hpo_train) functionality. 100 trials were run. Early stopping was applied during training. The best performing model was selected using the macro F1 performance on the validation set. The selected hyperparameters are in the table below.
|
| 58 |
+
|
| 59 |
+
| Hyperparameter | Value |
|
| 60 |
+
|----------------|-------|
|
| 61 |
+
| epochs | 9.0 |
|
| 62 |
+
| learning_rate | 4.2369194386745274e-05 |
|
| 63 |
+
| per_device_train_batch_size | 8 |
|
| 64 |
+
| weight_decay | 0.11095292966544487 |
|
| 65 |
+
| warmup_ratio | 0.009641097927077978 |
|
| 66 |
+
|
best_hyperparameters.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"epochs": 9.0,
|
| 3 |
+
"learning_rate": 4.2369194386745274e-05,
|
| 4 |
+
"per_device_train_batch_size": 8,
|
| 5 |
+
"weight_decay": 0.11095292966544487,
|
| 6 |
+
"warmup_ratio": 0.009641097927077978
|
| 7 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertForTokenClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"classifier_dropout": null,
|
| 8 |
+
"hidden_act": "gelu",
|
| 9 |
+
"hidden_dropout_prob": 0.1,
|
| 10 |
+
"hidden_size": 768,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "O",
|
| 13 |
+
"1": "B-DiseaseClass",
|
| 14 |
+
"2": "I-DiseaseClass",
|
| 15 |
+
"3": "B-SpecificDisease",
|
| 16 |
+
"4": "I-SpecificDisease"
|
| 17 |
+
},
|
| 18 |
+
"initializer_range": 0.02,
|
| 19 |
+
"intermediate_size": 3072,
|
| 20 |
+
"layer_norm_eps": 1e-12,
|
| 21 |
+
"max_position_embeddings": 512,
|
| 22 |
+
"model_type": "bert",
|
| 23 |
+
"num_attention_heads": 12,
|
| 24 |
+
"num_hidden_layers": 12,
|
| 25 |
+
"pad_token_id": 0,
|
| 26 |
+
"position_embedding_type": "absolute",
|
| 27 |
+
"torch_dtype": "float32",
|
| 28 |
+
"transformers_version": "4.48.1",
|
| 29 |
+
"type_vocab_size": 2,
|
| 30 |
+
"use_cache": true,
|
| 31 |
+
"vocab_size": 30522
|
| 32 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:41f40476612ba87cd2da8e641f59d9e2e82a56d63662eab279b6d045a80a3198
|
| 3 |
+
size 435605316
|
performance_report.json
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"train": {
|
| 3 |
+
"token_level": {
|
| 4 |
+
"O": {
|
| 5 |
+
"precision": 0.9998746044508043,
|
| 6 |
+
"recall": 0.9994322831800989,
|
| 7 |
+
"f1-score": 0.9996533948864684,
|
| 8 |
+
"support": 135631.0
|
| 9 |
+
},
|
| 10 |
+
"B-DiseaseClass": {
|
| 11 |
+
"precision": 0.9935064935064936,
|
| 12 |
+
"recall": 0.9947984395318595,
|
| 13 |
+
"f1-score": 0.9941520467836257,
|
| 14 |
+
"support": 769.0
|
| 15 |
+
},
|
| 16 |
+
"I-DiseaseClass": {
|
| 17 |
+
"precision": 0.9964080459770115,
|
| 18 |
+
"recall": 0.9914224446032881,
|
| 19 |
+
"f1-score": 0.9939089931924041,
|
| 20 |
+
"support": 1399.0
|
| 21 |
+
},
|
| 22 |
+
"B-SpecificDisease": {
|
| 23 |
+
"precision": 0.9986518368722616,
|
| 24 |
+
"recall": 0.9976430976430977,
|
| 25 |
+
"f1-score": 0.9981472123968335,
|
| 26 |
+
"support": 2970.0
|
| 27 |
+
},
|
| 28 |
+
"I-SpecificDisease": {
|
| 29 |
+
"precision": 0.9895332390381896,
|
| 30 |
+
"recall": 0.9992858163119555,
|
| 31 |
+
"f1-score": 0.9943856158055575,
|
| 32 |
+
"support": 7001.0
|
| 33 |
+
},
|
| 34 |
+
"accuracy": 0.9992894362861203,
|
| 35 |
+
"macro avg": {
|
| 36 |
+
"precision": 0.9955948439689521,
|
| 37 |
+
"recall": 0.99651641625406,
|
| 38 |
+
"f1-score": 0.9960494526129778,
|
| 39 |
+
"support": 147770.0
|
| 40 |
+
},
|
| 41 |
+
"weighted avg": {
|
| 42 |
+
"precision": 0.9992941191589114,
|
| 43 |
+
"recall": 0.9992894362861203,
|
| 44 |
+
"f1-score": 0.9992905334260858,
|
| 45 |
+
"support": 147770.0
|
| 46 |
+
}
|
| 47 |
+
},
|
| 48 |
+
"span_level": {
|
| 49 |
+
"DiseaseClass": {
|
| 50 |
+
"precision": 0.9883419689119171,
|
| 51 |
+
"recall": 0.9921976592977894,
|
| 52 |
+
"f1-score": 0.9902660609993511,
|
| 53 |
+
"support": 769
|
| 54 |
+
},
|
| 55 |
+
"SpecificDisease": {
|
| 56 |
+
"precision": 0.973927392739274,
|
| 57 |
+
"recall": 0.9929340511440108,
|
| 58 |
+
"f1-score": 0.9833388870376542,
|
| 59 |
+
"support": 2972
|
| 60 |
+
},
|
| 61 |
+
"macro avg": {
|
| 62 |
+
"precision": 0.9811346808255955,
|
| 63 |
+
"recall": 0.9925658552209,
|
| 64 |
+
"f1-score": 0.9868024740185026,
|
| 65 |
+
"support": 3741
|
| 66 |
+
},
|
| 67 |
+
"weighted avg": {
|
| 68 |
+
"precision": 0.976890453171448,
|
| 69 |
+
"recall": 0.9927826784282278,
|
| 70 |
+
"f1-score": 0.9847628369912882,
|
| 71 |
+
"support": 3741
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
},
|
| 75 |
+
"val": {
|
| 76 |
+
"token_level": {
|
| 77 |
+
"O": {
|
| 78 |
+
"precision": 0.9942266157168965,
|
| 79 |
+
"recall": 0.9965860360547899,
|
| 80 |
+
"f1-score": 0.995404927747167,
|
| 81 |
+
"support": 24019.0
|
| 82 |
+
},
|
| 83 |
+
"B-DiseaseClass": {
|
| 84 |
+
"precision": 0.8490566037735849,
|
| 85 |
+
"recall": 0.7142857142857143,
|
| 86 |
+
"f1-score": 0.7758620689655172,
|
| 87 |
+
"support": 126.0
|
| 88 |
+
},
|
| 89 |
+
"I-DiseaseClass": {
|
| 90 |
+
"precision": 0.821917808219178,
|
| 91 |
+
"recall": 0.6857142857142857,
|
| 92 |
+
"f1-score": 0.7476635514018691,
|
| 93 |
+
"support": 175.0
|
| 94 |
+
},
|
| 95 |
+
"B-SpecificDisease": {
|
| 96 |
+
"precision": 0.8813559322033898,
|
| 97 |
+
"recall": 0.883495145631068,
|
| 98 |
+
"f1-score": 0.8824242424242424,
|
| 99 |
+
"support": 412.0
|
| 100 |
+
},
|
| 101 |
+
"I-SpecificDisease": {
|
| 102 |
+
"precision": 0.922992299229923,
|
| 103 |
+
"recall": 0.9139433551198257,
|
| 104 |
+
"f1-score": 0.9184455391351943,
|
| 105 |
+
"support": 918.0
|
| 106 |
+
},
|
| 107 |
+
"accuracy": 0.9883040935672515,
|
| 108 |
+
"macro avg": {
|
| 109 |
+
"precision": 0.8939098518285944,
|
| 110 |
+
"recall": 0.8388049073611367,
|
| 111 |
+
"f1-score": 0.863960065934798,
|
| 112 |
+
"support": 25650.0
|
| 113 |
+
},
|
| 114 |
+
"weighted avg": {
|
| 115 |
+
"precision": 0.9879754934182778,
|
| 116 |
+
"recall": 0.9883040935672515,
|
| 117 |
+
"f1-score": 0.9880671537835901,
|
| 118 |
+
"support": 25650.0
|
| 119 |
+
}
|
| 120 |
+
},
|
| 121 |
+
"span_level": {
|
| 122 |
+
"DiseaseClass": {
|
| 123 |
+
"precision": 0.7631578947368421,
|
| 124 |
+
"recall": 0.6904761904761905,
|
| 125 |
+
"f1-score": 0.725,
|
| 126 |
+
"support": 126
|
| 127 |
+
},
|
| 128 |
+
"SpecificDisease": {
|
| 129 |
+
"precision": 0.8411214953271028,
|
| 130 |
+
"recall": 0.8737864077669902,
|
| 131 |
+
"f1-score": 0.8571428571428571,
|
| 132 |
+
"support": 412
|
| 133 |
+
},
|
| 134 |
+
"macro avg": {
|
| 135 |
+
"precision": 0.8021396950319725,
|
| 136 |
+
"recall": 0.7821312991215903,
|
| 137 |
+
"f1-score": 0.7910714285714285,
|
| 138 |
+
"support": 538
|
| 139 |
+
},
|
| 140 |
+
"weighted avg": {
|
| 141 |
+
"precision": 0.8228623621033615,
|
| 142 |
+
"recall": 0.8308550185873605,
|
| 143 |
+
"f1-score": 0.8261949017525225,
|
| 144 |
+
"support": 538
|
| 145 |
+
}
|
| 146 |
+
}
|
| 147 |
+
},
|
| 148 |
+
"test": {
|
| 149 |
+
"token_level": {
|
| 150 |
+
"O": {
|
| 151 |
+
"precision": 0.9955296723126769,
|
| 152 |
+
"recall": 0.9908159516714968,
|
| 153 |
+
"f1-score": 0.9931672190172252,
|
| 154 |
+
"support": 24499.0
|
| 155 |
+
},
|
| 156 |
+
"B-DiseaseClass": {
|
| 157 |
+
"precision": 0.62,
|
| 158 |
+
"recall": 0.768595041322314,
|
| 159 |
+
"f1-score": 0.6863468634686347,
|
| 160 |
+
"support": 121.0
|
| 161 |
+
},
|
| 162 |
+
"I-DiseaseClass": {
|
| 163 |
+
"precision": 0.5545454545454546,
|
| 164 |
+
"recall": 0.7484662576687117,
|
| 165 |
+
"f1-score": 0.6370757180156658,
|
| 166 |
+
"support": 163.0
|
| 167 |
+
},
|
| 168 |
+
"B-SpecificDisease": {
|
| 169 |
+
"precision": 0.8444444444444444,
|
| 170 |
+
"recall": 0.8216216216216217,
|
| 171 |
+
"f1-score": 0.8328767123287671,
|
| 172 |
+
"support": 555.0
|
| 173 |
+
},
|
| 174 |
+
"I-SpecificDisease": {
|
| 175 |
+
"precision": 0.8679549114331723,
|
| 176 |
+
"recall": 0.9005847953216374,
|
| 177 |
+
"f1-score": 0.8839688396883969,
|
| 178 |
+
"support": 1197.0
|
| 179 |
+
},
|
| 180 |
+
"accuracy": 0.980704729602412,
|
| 181 |
+
"macro avg": {
|
| 182 |
+
"precision": 0.7764948965471496,
|
| 183 |
+
"recall": 0.8460167335211564,
|
| 184 |
+
"f1-score": 0.8066870705037379,
|
| 185 |
+
"support": 26535.0
|
| 186 |
+
},
|
| 187 |
+
"weighted avg": {
|
| 188 |
+
"precision": 0.9821933690119222,
|
| 189 |
+
"recall": 0.980704729602412,
|
| 190 |
+
"f1-score": 0.9813021401043428,
|
| 191 |
+
"support": 26535.0
|
| 192 |
+
}
|
| 193 |
+
},
|
| 194 |
+
"span_level": {
|
| 195 |
+
"DiseaseClass": {
|
| 196 |
+
"precision": 0.5923566878980892,
|
| 197 |
+
"recall": 0.768595041322314,
|
| 198 |
+
"f1-score": 0.6690647482014389,
|
| 199 |
+
"support": 121
|
| 200 |
+
},
|
| 201 |
+
"SpecificDisease": {
|
| 202 |
+
"precision": 0.8163636363636364,
|
| 203 |
+
"recall": 0.809009009009009,
|
| 204 |
+
"f1-score": 0.8126696832579184,
|
| 205 |
+
"support": 555
|
| 206 |
+
},
|
| 207 |
+
"macro avg": {
|
| 208 |
+
"precision": 0.7043601621308628,
|
| 209 |
+
"recall": 0.7888020251656616,
|
| 210 |
+
"f1-score": 0.7408672157296787,
|
| 211 |
+
"support": 676
|
| 212 |
+
},
|
| 213 |
+
"weighted avg": {
|
| 214 |
+
"precision": 0.7762677180732056,
|
| 215 |
+
"recall": 0.8017751479289941,
|
| 216 |
+
"f1-score": 0.7869652496161522,
|
| 217 |
+
"support": 676
|
| 218 |
+
}
|
| 219 |
+
}
|
| 220 |
+
}
|
| 221 |
+
}
|
performance_report.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Performance on Training Set
|
| 2 |
+
|
| 3 |
+
## Span Level
|
| 4 |
+
|
| 5 |
+
| Label | Precision | Recall | F1-score | Support |
|
| 6 |
+
| --- | --- | --- | --- | --- |
|
| 7 |
+
| DiseaseClass | 0.988 | 0.992 | 0.990 | 769 |
|
| 8 |
+
| SpecificDisease | 0.974 | 0.993 | 0.983 | 2972 |
|
| 9 |
+
| macro avg | 0.981 | 0.993 | 0.987 | 3741 |
|
| 10 |
+
| weighted avg | 0.977 | 0.993 | 0.985 | 3741 |
|
| 11 |
+
|
| 12 |
+
## Token Level
|
| 13 |
+
|
| 14 |
+
| Label | Precision | Recall | F1-score | Support |
|
| 15 |
+
| --- | --- | --- | --- | --- |
|
| 16 |
+
| O | 1.000 | 0.999 | 1.000 | 135631 |
|
| 17 |
+
| B-DiseaseClass | 0.994 | 0.995 | 0.994 | 769 |
|
| 18 |
+
| I-DiseaseClass | 0.996 | 0.991 | 0.994 | 1399 |
|
| 19 |
+
| B-SpecificDisease | 0.999 | 0.998 | 0.998 | 2970 |
|
| 20 |
+
| I-SpecificDisease | 0.990 | 0.999 | 0.994 | 7001 |
|
| 21 |
+
| macro avg | 0.996 | 0.997 | 0.996 | 147770 |
|
| 22 |
+
| weighted avg | 0.999 | 0.999 | 0.999 | 147770 |
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
# Performance on Validation Set
|
| 26 |
+
|
| 27 |
+
## Span Level
|
| 28 |
+
|
| 29 |
+
| Label | Precision | Recall | F1-score | Support |
|
| 30 |
+
| --- | --- | --- | --- | --- |
|
| 31 |
+
| DiseaseClass | 0.763 | 0.690 | 0.725 | 126 |
|
| 32 |
+
| SpecificDisease | 0.841 | 0.874 | 0.857 | 412 |
|
| 33 |
+
| macro avg | 0.802 | 0.782 | 0.791 | 538 |
|
| 34 |
+
| weighted avg | 0.823 | 0.831 | 0.826 | 538 |
|
| 35 |
+
|
| 36 |
+
## Token Level
|
| 37 |
+
|
| 38 |
+
| Label | Precision | Recall | F1-score | Support |
|
| 39 |
+
| --- | --- | --- | --- | --- |
|
| 40 |
+
| O | 0.994 | 0.997 | 0.995 | 24019 |
|
| 41 |
+
| B-DiseaseClass | 0.849 | 0.714 | 0.776 | 126 |
|
| 42 |
+
| I-DiseaseClass | 0.822 | 0.686 | 0.748 | 175 |
|
| 43 |
+
| B-SpecificDisease | 0.881 | 0.883 | 0.882 | 412 |
|
| 44 |
+
| I-SpecificDisease | 0.923 | 0.914 | 0.918 | 918 |
|
| 45 |
+
| macro avg | 0.894 | 0.839 | 0.864 | 25650 |
|
| 46 |
+
| weighted avg | 0.988 | 0.988 | 0.988 | 25650 |
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
# Performance on Testing Set
|
| 50 |
+
|
| 51 |
+
## Span Level
|
| 52 |
+
|
| 53 |
+
| Label | Precision | Recall | F1-score | Support |
|
| 54 |
+
| --- | --- | --- | --- | --- |
|
| 55 |
+
| DiseaseClass | 0.592 | 0.769 | 0.669 | 121 |
|
| 56 |
+
| SpecificDisease | 0.816 | 0.809 | 0.813 | 555 |
|
| 57 |
+
| macro avg | 0.704 | 0.789 | 0.741 | 676 |
|
| 58 |
+
| weighted avg | 0.776 | 0.802 | 0.787 | 676 |
|
| 59 |
+
|
| 60 |
+
## Token Level
|
| 61 |
+
|
| 62 |
+
| Label | Precision | Recall | F1-score | Support |
|
| 63 |
+
| --- | --- | --- | --- | --- |
|
| 64 |
+
| O | 0.996 | 0.991 | 0.993 | 24499 |
|
| 65 |
+
| B-DiseaseClass | 0.620 | 0.769 | 0.686 | 121 |
|
| 66 |
+
| I-DiseaseClass | 0.555 | 0.748 | 0.637 | 163 |
|
| 67 |
+
| B-SpecificDisease | 0.844 | 0.822 | 0.833 | 555 |
|
| 68 |
+
| I-SpecificDisease | 0.868 | 0.901 | 0.884 | 1197 |
|
| 69 |
+
| macro avg | 0.776 | 0.846 | 0.807 | 26535 |
|
| 70 |
+
| weighted avg | 0.982 | 0.981 | 0.981 | 26535 |
|
| 71 |
+
|
| 72 |
+
|
rng_state.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c325025280b89c0d4da3c9c2ad88816a8a0cc2c4c2de7729901f3971a2bc79ff
|
| 3 |
+
size 14244
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cls_token": "[CLS]",
|
| 3 |
+
"mask_token": "[MASK]",
|
| 4 |
+
"pad_token": "[PAD]",
|
| 5 |
+
"sep_token": "[SEP]",
|
| 6 |
+
"unk_token": "[UNK]"
|
| 7 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "[PAD]",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "[UNK]",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "[CLS]",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "[SEP]",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"4": {
|
| 36 |
+
"content": "[MASK]",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"clean_up_tokenization_spaces": true,
|
| 45 |
+
"cls_token": "[CLS]",
|
| 46 |
+
"do_basic_tokenize": true,
|
| 47 |
+
"do_lower_case": true,
|
| 48 |
+
"extra_special_tokens": {},
|
| 49 |
+
"mask_token": "[MASK]",
|
| 50 |
+
"model_max_length": 512,
|
| 51 |
+
"never_split": null,
|
| 52 |
+
"pad_token": "[PAD]",
|
| 53 |
+
"sep_token": "[SEP]",
|
| 54 |
+
"strip_accents": null,
|
| 55 |
+
"tokenize_chinese_chars": true,
|
| 56 |
+
"tokenizer_class": "BertTokenizer",
|
| 57 |
+
"unk_token": "[UNK]"
|
| 58 |
+
}
|
trainer_state.json
ADDED
|
@@ -0,0 +1,162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3 |
+
"best_model_checkpoint": "tmp_ner_fantastic-bale-09_44/run-61/checkpoint-675",
|
| 4 |
+
"epoch": 9.0,
|
| 5 |
+
"eval_steps": 500,
|
| 6 |
+
"global_step": 675,
|
| 7 |
+
"is_hyper_param_search": true,
|
| 8 |
+
"is_local_process_zero": true,
|
| 9 |
+
"is_world_process_zero": true,
|
| 10 |
+
"log_history": [
|
| 11 |
+
{
|
| 12 |
+
"epoch": 1.0,
|
| 13 |
+
"eval_accuracy": 0.9783235867446394,
|
| 14 |
+
"eval_loss": 0.06952951103448868,
|
| 15 |
+
"eval_macro_f1": 0.6359234331864915,
|
| 16 |
+
"eval_macro_precision": 0.8484880913225343,
|
| 17 |
+
"eval_macro_recall": 0.621665816946364,
|
| 18 |
+
"eval_runtime": 0.6216,
|
| 19 |
+
"eval_samples_per_second": 160.873,
|
| 20 |
+
"eval_steps_per_second": 20.913,
|
| 21 |
+
"step": 75
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"epoch": 2.0,
|
| 25 |
+
"eval_accuracy": 0.983391812865497,
|
| 26 |
+
"eval_loss": 0.056511040776968,
|
| 27 |
+
"eval_macro_f1": 0.7614548378523822,
|
| 28 |
+
"eval_macro_precision": 0.8731710257534685,
|
| 29 |
+
"eval_macro_recall": 0.7203600182300229,
|
| 30 |
+
"eval_runtime": 0.6015,
|
| 31 |
+
"eval_samples_per_second": 166.249,
|
| 32 |
+
"eval_steps_per_second": 21.612,
|
| 33 |
+
"step": 150
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"epoch": 3.0,
|
| 37 |
+
"eval_accuracy": 0.9857309941520468,
|
| 38 |
+
"eval_loss": 0.05191269889473915,
|
| 39 |
+
"eval_macro_f1": 0.8172545857097553,
|
| 40 |
+
"eval_macro_precision": 0.8413749539052772,
|
| 41 |
+
"eval_macro_recall": 0.7970101814719535,
|
| 42 |
+
"eval_runtime": 0.6777,
|
| 43 |
+
"eval_samples_per_second": 147.557,
|
| 44 |
+
"eval_steps_per_second": 19.182,
|
| 45 |
+
"step": 225
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"epoch": 4.0,
|
| 49 |
+
"eval_accuracy": 0.9871734892787525,
|
| 50 |
+
"eval_loss": 0.055695317685604095,
|
| 51 |
+
"eval_macro_f1": 0.8405769067306196,
|
| 52 |
+
"eval_macro_precision": 0.8557959065634769,
|
| 53 |
+
"eval_macro_recall": 0.8269452880439045,
|
| 54 |
+
"eval_runtime": 0.6377,
|
| 55 |
+
"eval_samples_per_second": 156.826,
|
| 56 |
+
"eval_steps_per_second": 20.387,
|
| 57 |
+
"step": 300
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"epoch": 5.0,
|
| 61 |
+
"eval_accuracy": 0.9875243664717349,
|
| 62 |
+
"eval_loss": 0.055003080517053604,
|
| 63 |
+
"eval_macro_f1": 0.8540405601187896,
|
| 64 |
+
"eval_macro_precision": 0.8983484203175353,
|
| 65 |
+
"eval_macro_recall": 0.8221656291922347,
|
| 66 |
+
"eval_runtime": 0.6394,
|
| 67 |
+
"eval_samples_per_second": 156.406,
|
| 68 |
+
"eval_steps_per_second": 20.333,
|
| 69 |
+
"step": 375
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"epoch": 6.0,
|
| 73 |
+
"eval_accuracy": 0.9878362573099415,
|
| 74 |
+
"eval_loss": 0.060502711683511734,
|
| 75 |
+
"eval_macro_f1": 0.8610460620824656,
|
| 76 |
+
"eval_macro_precision": 0.8865353357904526,
|
| 77 |
+
"eval_macro_recall": 0.8387695106889209,
|
| 78 |
+
"eval_runtime": 0.6171,
|
| 79 |
+
"eval_samples_per_second": 162.056,
|
| 80 |
+
"eval_steps_per_second": 21.067,
|
| 81 |
+
"step": 450
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"epoch": 6.666666666666667,
|
| 85 |
+
"grad_norm": 0.02602095529437065,
|
| 86 |
+
"learning_rate": 3.3881089787380476e-05,
|
| 87 |
+
"loss": 0.08,
|
| 88 |
+
"step": 500
|
| 89 |
+
},
|
| 90 |
+
{
|
| 91 |
+
"epoch": 7.0,
|
| 92 |
+
"eval_accuracy": 0.9864327485380117,
|
| 93 |
+
"eval_loss": 0.06403131783008575,
|
| 94 |
+
"eval_macro_f1": 0.836324040811885,
|
| 95 |
+
"eval_macro_precision": 0.8309543877948833,
|
| 96 |
+
"eval_macro_recall": 0.8430665699031182,
|
| 97 |
+
"eval_runtime": 0.6657,
|
| 98 |
+
"eval_samples_per_second": 150.212,
|
| 99 |
+
"eval_steps_per_second": 19.528,
|
| 100 |
+
"step": 525
|
| 101 |
+
},
|
| 102 |
+
{
|
| 103 |
+
"epoch": 8.0,
|
| 104 |
+
"eval_accuracy": 0.9874463937621832,
|
| 105 |
+
"eval_loss": 0.06809797883033752,
|
| 106 |
+
"eval_macro_f1": 0.853127015308474,
|
| 107 |
+
"eval_macro_precision": 0.871470843170948,
|
| 108 |
+
"eval_macro_recall": 0.8370896203600997,
|
| 109 |
+
"eval_runtime": 0.6629,
|
| 110 |
+
"eval_samples_per_second": 150.862,
|
| 111 |
+
"eval_steps_per_second": 19.612,
|
| 112 |
+
"step": 600
|
| 113 |
+
},
|
| 114 |
+
{
|
| 115 |
+
"epoch": 9.0,
|
| 116 |
+
"eval_accuracy": 0.9883040935672515,
|
| 117 |
+
"eval_loss": 0.06698578596115112,
|
| 118 |
+
"eval_macro_f1": 0.863960065934798,
|
| 119 |
+
"eval_macro_precision": 0.8939098518285944,
|
| 120 |
+
"eval_macro_recall": 0.8388049073611367,
|
| 121 |
+
"eval_runtime": 0.6334,
|
| 122 |
+
"eval_samples_per_second": 157.89,
|
| 123 |
+
"eval_steps_per_second": 20.526,
|
| 124 |
+
"step": 675
|
| 125 |
+
}
|
| 126 |
+
],
|
| 127 |
+
"logging_steps": 500,
|
| 128 |
+
"max_steps": 2400,
|
| 129 |
+
"num_input_tokens_seen": 0,
|
| 130 |
+
"num_train_epochs": 32,
|
| 131 |
+
"save_steps": 500,
|
| 132 |
+
"stateful_callbacks": {
|
| 133 |
+
"EarlyStoppingCallback": {
|
| 134 |
+
"args": {
|
| 135 |
+
"early_stopping_patience": 3,
|
| 136 |
+
"early_stopping_threshold": 0.001
|
| 137 |
+
},
|
| 138 |
+
"attributes": {
|
| 139 |
+
"early_stopping_patience_counter": 0
|
| 140 |
+
}
|
| 141 |
+
},
|
| 142 |
+
"TrainerControl": {
|
| 143 |
+
"args": {
|
| 144 |
+
"should_epoch_stop": false,
|
| 145 |
+
"should_evaluate": false,
|
| 146 |
+
"should_log": false,
|
| 147 |
+
"should_save": true,
|
| 148 |
+
"should_training_stop": false
|
| 149 |
+
},
|
| 150 |
+
"attributes": {}
|
| 151 |
+
}
|
| 152 |
+
},
|
| 153 |
+
"total_flos": 768333841626390.0,
|
| 154 |
+
"train_batch_size": 8,
|
| 155 |
+
"trial_name": null,
|
| 156 |
+
"trial_params": {
|
| 157 |
+
"learning_rate": 4.2369194386745274e-05,
|
| 158 |
+
"per_device_train_batch_size": 8,
|
| 159 |
+
"warmup_ratio": 0.009641097927077978,
|
| 160 |
+
"weight_decay": 0.11095292966544487
|
| 161 |
+
}
|
| 162 |
+
}
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|