Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,147 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
# Model Card for
|
| 7 |
-
|
| 8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
| 12 |
## Model Details
|
| 13 |
|
| 14 |
### Model Description
|
| 15 |
|
| 16 |
-
|
| 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:** [
|
| 21 |
-
- **
|
| 22 |
-
- **
|
| 23 |
-
- **
|
| 24 |
-
- **
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
| 28 |
-
### Model Sources
|
| 29 |
|
| 30 |
-
|
| 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 |
-
|
| 43 |
-
|
| 44 |
-
[More Information Needed]
|
| 45 |
|
| 46 |
-
### Downstream Use
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
| 51 |
|
| 52 |
### Out-of-Scope Use
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
|
| 58 |
## Bias, Risks, and Limitations
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
|
| 64 |
### Recommendations
|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
|
|
|
| 69 |
|
| 70 |
## How to Get Started with the Model
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
## Training Details
|
| 77 |
|
| 78 |
### Training Data
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
|
| 84 |
### Training Procedure
|
| 85 |
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
|
| 93 |
#### Training Hyperparameters
|
| 94 |
-
|
| 95 |
-
- **Training
|
| 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 |
-
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
-
|
| 115 |
-
#### Factors
|
| 116 |
-
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
|
| 121 |
#### Metrics
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
### Results
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
|
| 141 |
## Environmental Impact
|
| 142 |
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 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 |
-
|
| 179 |
-
**APA:**
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
|
| 189 |
-
##
|
| 190 |
|
| 191 |
-
|
|
|
|
|
|
|
| 192 |
|
| 193 |
-
##
|
| 194 |
|
| 195 |
-
[
|
| 196 |
|
| 197 |
-
##
|
| 198 |
|
| 199 |
-
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
+
tags:
|
| 4 |
+
- biobert
|
| 5 |
+
- medical-nlp
|
| 6 |
+
- icd-9
|
| 7 |
+
- classification
|
| 8 |
+
- healthcare
|
| 9 |
+
license: apache-2.0
|
| 10 |
+
language:
|
| 11 |
+
- en
|
| 12 |
+
base_model:
|
| 13 |
+
- dmis-lab/biobert-v1.1
|
| 14 |
+
pipeline_tag: text-classification
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# Model Card for BioBERT Fine-tuned on MIMIC-3 for ICD-9 Code Classification
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
## Model Details
|
| 20 |
|
| 21 |
### Model Description
|
| 22 |
|
| 23 |
+
This is a BioBERT model fine-tuned on the MIMIC-3 (Medical Information Mart for Intensive Care) corpus specifically for ICD-9 code classification. The model is designed to predict medical diagnostic codes based on Electronic Health Record (EHR) and symptom text inputs.
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
- **Developed by:** [Researcher/Institution Name - to be added]
|
| 26 |
+
- **Model type:** Transformer-based medical language model (BioBERT)
|
| 27 |
+
- **Language(s):** English (Medical Domain)
|
| 28 |
+
- **License:** [License to be specified]
|
| 29 |
+
- **Finetuned from model:** BioBERT base model
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
### Model Sources
|
| 32 |
|
| 33 |
+
- **Repository:** [GitHub/Model Repository Link - to be added]
|
| 34 |
+
- **Paper:** [Research Paper Link - to be added]
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
## Uses
|
| 37 |
|
|
|
|
|
|
|
| 38 |
### Direct Use
|
| 39 |
|
| 40 |
+
The primary use of this model is to automatically classify medical conditions by predicting relevant ICD-9 diagnostic codes from clinical text, such as electronic health records, medical notes, or symptom descriptions.
|
|
|
|
|
|
|
| 41 |
|
| 42 |
+
### Downstream Use
|
| 43 |
|
| 44 |
+
This model can be integrated into:
|
| 45 |
+
- Clinical decision support systems
|
| 46 |
+
- Medical coding automation
|
| 47 |
+
- Electronic health record (EHR) analysis tools
|
| 48 |
+
- Healthcare informatics research
|
| 49 |
|
| 50 |
### Out-of-Scope Use
|
| 51 |
|
| 52 |
+
- The model should not be used for direct medical diagnosis without professional medical oversight
|
| 53 |
+
- It is not intended to replace clinical judgment
|
| 54 |
+
- Performance may vary with text outside the medical domain or significantly different from the training corpus
|
| 55 |
|
| 56 |
## Bias, Risks, and Limitations
|
| 57 |
|
| 58 |
+
- The model's performance is limited to the medical conditions and coding patterns in the MIMIC-3 dataset
|
| 59 |
+
- Potential biases from the original training data may be present
|
| 60 |
+
- Accuracy can be affected by variations in medical terminology, writing styles, and complex medical cases
|
| 61 |
|
| 62 |
### Recommendations
|
| 63 |
|
| 64 |
+
- Validate model predictions with medical professionals
|
| 65 |
+
- Use as a supportive tool, not a replacement for expert medical assessment
|
| 66 |
+
- Regularly evaluate performance on new datasets
|
| 67 |
+
- Be aware of potential demographic or contextual biases in the predictions
|
| 68 |
|
| 69 |
## How to Get Started with the Model
|
| 70 |
|
| 71 |
+
```python
|
| 72 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 73 |
+
import torch
|
| 74 |
+
|
| 75 |
+
# Load the model and tokenizer
|
| 76 |
+
model = AutoModelForSequenceClassification.from_pretrained('model_path')
|
| 77 |
+
tokenizer = AutoTokenizer.from_pretrained('model_path')
|
| 78 |
+
|
| 79 |
+
# Example prediction function (similar to the provided get_predictions function)
|
| 80 |
+
def predict_icd9_codes(input_text, threshold=0.8):
|
| 81 |
+
# Tokenize input
|
| 82 |
+
inputs = tokenizer(input_text, return_tensors="pt", truncation=True, max_length=512, padding='max_length')
|
| 83 |
+
|
| 84 |
+
# Get model predictions
|
| 85 |
+
with torch.no_grad():
|
| 86 |
+
outputs = model(**inputs)
|
| 87 |
+
predictions = torch.sigmoid(outputs.logits)
|
| 88 |
+
|
| 89 |
+
# Filter predictions above threshold
|
| 90 |
+
predicted_codes = [model.config.id2label[i] for i in (predictions > threshold).nonzero()[:, 1]]
|
| 91 |
+
|
| 92 |
+
return predicted_codes
|
| 93 |
+
```
|
| 94 |
|
| 95 |
## Training Details
|
| 96 |
|
| 97 |
### Training Data
|
| 98 |
|
| 99 |
+
- **Dataset:** MIMIC-3 Corpus
|
| 100 |
+
- **Domain:** Medical/Clinical text
|
| 101 |
+
- **Content:** Electronic Health Records (EHR)
|
| 102 |
|
| 103 |
### Training Procedure
|
| 104 |
|
| 105 |
+
#### Preprocessing
|
| 106 |
+
- Text tokenization
|
| 107 |
+
- Maximum sequence length: 512 tokens
|
| 108 |
+
- Padding to uniform length
|
| 109 |
+
- Potential text normalization techniques
|
|
|
|
| 110 |
|
| 111 |
#### Training Hyperparameters
|
| 112 |
+
- **Base Model:** BioBERT
|
| 113 |
+
- **Training Regime:** Fine-tuning
|
| 114 |
+
- **Precision:** [Specify training precision, e.g., mixed precision]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
| 116 |
## Evaluation
|
| 117 |
|
|
|
|
|
|
|
| 118 |
### Testing Data, Factors & Metrics
|
| 119 |
|
| 120 |
#### Testing Data
|
| 121 |
+
- Held-out subset of MIMIC-3 corpus
|
| 122 |
+
- Diverse medical cases and documentation styles
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
#### Metrics
|
| 125 |
+
- Precision
|
| 126 |
+
- Recall
|
| 127 |
+
- F1-Score
|
| 128 |
+
- Multi-label classification metrics
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
## Environmental Impact
|
| 131 |
|
| 132 |
+
- Estimated carbon emissions to be calculated
|
| 133 |
+
- Compute details to be specified
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
+
## Technical Specifications
|
| 136 |
|
| 137 |
+
### Model Architecture
|
| 138 |
+
- **Base Model:** BioBERT
|
| 139 |
+
- **Task:** Multi-label ICD-9 Code Classification
|
| 140 |
|
| 141 |
+
## Citation
|
| 142 |
|
| 143 |
+
[Citation information to be added when research is published]
|
| 144 |
|
| 145 |
+
## More Information
|
| 146 |
|
| 147 |
+
For more details about the model's development, performance, and usage, please contact the model developers.
|