Update README.md
Browse files
README.md
CHANGED
@@ -1,169 +1,108 @@
|
|
1 |
-
|
2 |
-
library_name: transformers
|
3 |
-
tags:
|
4 |
-
- medical
|
5 |
-
license: mit
|
6 |
-
language:
|
7 |
-
- en
|
8 |
-
base_model:
|
9 |
-
- ShahRishi/OphthaBERT-v2
|
10 |
-
pipeline_tag: text-classification
|
11 |
-
---
|
12 |
-
|
13 |
-
# OphtaBERT Glaucoma Classifier
|
14 |
|
15 |
Binary classification for glaucoma diagnosis extraction from unstructured clinical notes.
|
16 |
|
|
|
17 |
|
|
|
|
|
18 |
|
19 |
-
|
|
|
20 |
|
21 |
-
|
22 |
-
This model is a fine tuned variant of OphthaBERT, which was pretrained on over 2 million clinical notes. This model has been fine tuned for binary classification on labeled clinical notes from Massachusetts Eye and Ear Infirmary.
|
23 |
|
24 |
-
|
|
|
25 |
|
26 |
-
|
27 |
-
We suggest utlizing this model zero-shot for generating binary glaucoma labels for each clininical notes. For continued training on limited data, we suggest freezing the first 10 layers of the model.
|
28 |
-
### Direct Use
|
29 |
|
|
|
|
|
|
|
30 |
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
Use the code below to get started with the model.
|
41 |
-
|
42 |
-
```
|
43 |
-
model = AutoModelForSequenceClassification.from_pretrained("ShahRishi/OphthaBERT-v2-glaucoma-binary"
|
44 |
-
```
|
45 |
-
|
46 |
-
## Training Details
|
47 |
-
|
48 |
-
### Training Data
|
49 |
|
|
|
50 |
<!-- 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. -->
|
51 |
-
|
52 |
[More Information Needed]
|
53 |
|
54 |
-
|
55 |
-
|
56 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
57 |
-
|
58 |
-
#### Preprocessing [optional]
|
59 |
|
60 |
[More Information Needed]
|
61 |
|
|
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
66 |
-
|
67 |
-
#### Speeds, Sizes, Times [optional]
|
68 |
|
69 |
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
70 |
-
|
71 |
[More Information Needed]
|
72 |
|
73 |
-
|
74 |
|
75 |
<!-- This section describes the evaluation protocols and provides the results. -->
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
#### Testing Data
|
80 |
|
81 |
<!-- This should link to a Dataset Card if possible. -->
|
82 |
-
|
83 |
[More Information Needed]
|
84 |
|
85 |
-
|
86 |
|
87 |
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
88 |
-
|
89 |
[More Information Needed]
|
90 |
|
91 |
-
|
92 |
|
93 |
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
94 |
-
|
95 |
[More Information Needed]
|
96 |
|
97 |
-
|
98 |
-
|
99 |
[More Information Needed]
|
100 |
|
101 |
-
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
## Model Examination [optional]
|
106 |
|
107 |
<!-- Relevant interpretability work for the model goes here -->
|
108 |
-
|
109 |
[More Information Needed]
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
114 |
-
|
115 |
-
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).
|
116 |
|
117 |
-
|
118 |
-
- **Hours used:** [More Information Needed]
|
119 |
-
- **Cloud Provider:** [More Information Needed]
|
120 |
-
- **Compute Region:** [More Information Needed]
|
121 |
-
- **Carbon Emitted:** [More Information Needed]
|
122 |
|
123 |
-
|
124 |
-
|
125 |
-
|
|
|
|
|
|
|
126 |
|
|
|
127 |
[More Information Needed]
|
128 |
|
129 |
-
|
130 |
-
|
131 |
[More Information Needed]
|
132 |
|
133 |
-
|
134 |
|
135 |
[More Information Needed]
|
136 |
|
137 |
-
|
138 |
|
139 |
[More Information Needed]
|
140 |
|
141 |
-
## Citation [optional]
|
142 |
-
|
143 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
144 |
-
|
145 |
-
**BibTeX:**
|
146 |
-
|
147 |
-
[More Information Needed]
|
148 |
-
|
149 |
-
**APA:**
|
150 |
-
|
151 |
-
[More Information Needed]
|
152 |
-
|
153 |
-
## Glossary [optional]
|
154 |
-
|
155 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
## More Information [optional]
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
## Model Card Authors [optional]
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
## Model Card Contact
|
168 |
-
|
169 |
-
[More Information Needed]
|
|
|
1 |
+
OphtaBERT Glaucoma Classifier
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
Binary classification for glaucoma diagnosis extraction from unstructured clinical notes.
|
4 |
|
5 |
+
Model Details
|
6 |
|
7 |
+
Model Description
|
8 |
+
This model is a fine-tuned variant of OphthaBERT, which was pretrained on over 2 million clinical notes. It has been fine-tuned for binary classification on labeled clinical notes from Massachusetts Eye and Ear Infirmary.
|
9 |
|
10 |
+
Finetuned from model: [OphthaBERT-v2]
|
11 |
+
Uses
|
12 |
|
13 |
+
We suggest utilizing this model in a zero-shot manner to generate binary glaucoma labels for each clinical note. For continued training on limited data, we recommend freezing the first 10 layers of the model.
|
|
|
14 |
|
15 |
+
Direct Use
|
16 |
+
Use the code below to get started with the model:
|
17 |
|
18 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
|
|
|
|
19 |
|
20 |
+
# Load the fine-tuned model and tokenizer
|
21 |
+
model = AutoModelForSequenceClassification.from_pretrained("ShahRishi/OphthaBERT-v2-glaucoma-binary")
|
22 |
+
tokenizer = AutoTokenizer.from_pretrained("ShahRishi/OphthaBERT-v2-glaucoma-binary")
|
23 |
|
24 |
+
# Example: Classify a clinical note
|
25 |
+
clinical_note = "Example clinical note text..."
|
26 |
+
inputs = tokenizer(clinical_note, return_tensors="pt", truncation=True, max_length=512)
|
27 |
+
outputs = model(**inputs)
|
28 |
+
Out-of-Scope Use
|
29 |
+
All variants of BERT are known to struggle with negations; however, this model has been fine-tuned to handle both affirmative cases and negations. Note that the context window of the model is 512 tokens, so it is recommended to chunk notes longer than 512 tokens for inference.
|
30 |
|
31 |
+
Bias, Risks, and Limitations
|
32 |
|
33 |
+
All pretraining and fine-tuning were performed on anonymized notes from the Massachusetts Eye and Ear Infirmary.
|
34 |
|
35 |
+
Training Details
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
+
Training Data
|
38 |
<!-- 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. -->
|
|
|
39 |
[More Information Needed]
|
40 |
|
41 |
+
Training Procedure
|
|
|
42 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
43 |
+
Preprocessing [optional]
|
|
|
44 |
|
45 |
[More Information Needed]
|
46 |
|
47 |
+
Training Hyperparameters
|
48 |
|
49 |
+
Training regime: [More Information Needed] <!-- Options: fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
50 |
+
Speeds, Sizes, Times [optional]
|
|
|
|
|
|
|
51 |
|
52 |
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
|
|
53 |
[More Information Needed]
|
54 |
|
55 |
+
Evaluation
|
56 |
|
57 |
<!-- This section describes the evaluation protocols and provides the results. -->
|
58 |
+
Testing Data, Factors & Metrics
|
59 |
+
Testing Data
|
|
|
|
|
60 |
|
61 |
<!-- This should link to a Dataset Card if possible. -->
|
|
|
62 |
[More Information Needed]
|
63 |
|
64 |
+
Factors
|
65 |
|
66 |
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
|
|
67 |
[More Information Needed]
|
68 |
|
69 |
+
Metrics
|
70 |
|
71 |
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
|
|
72 |
[More Information Needed]
|
73 |
|
74 |
+
Results
|
|
|
75 |
[More Information Needed]
|
76 |
|
77 |
+
Summary
|
78 |
|
79 |
+
Model Examination [optional]
|
|
|
|
|
80 |
|
81 |
<!-- Relevant interpretability work for the model goes here -->
|
|
|
82 |
[More Information Needed]
|
83 |
|
84 |
+
Environmental Impact
|
|
|
|
|
|
|
|
|
85 |
|
86 |
+
Carbon emissions can be estimated using the Machine Learning Impact Calculator presented in Lacoste et al. (2019).
|
|
|
|
|
|
|
|
|
87 |
|
88 |
+
Hardware Type: [More Information Needed]
|
89 |
+
Hours used: [More Information Needed]
|
90 |
+
Cloud Provider: [More Information Needed]
|
91 |
+
Compute Region: [More Information Needed]
|
92 |
+
Carbon Emitted: [More Information Needed]
|
93 |
+
Technical Specifications [optional]
|
94 |
|
95 |
+
Model Architecture and Objective
|
96 |
[More Information Needed]
|
97 |
|
98 |
+
Compute Infrastructure
|
|
|
99 |
[More Information Needed]
|
100 |
|
101 |
+
Hardware
|
102 |
|
103 |
[More Information Needed]
|
104 |
|
105 |
+
Software
|
106 |
|
107 |
[More Information Needed]
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|