Views
No views yet
bert-base-uncased)96.5%, F1-score: 95.1%1from transformers import pipeline
2
3model = pipeline("text-classification", model="Lech-Iyoko/bert-symptom-checker")
4result = model("I have a severe headache and nausea.")
5print(result)
6
7## 📌 Limitations & Ethical Considerations
8- This model should not be used for medical diagnosis. Always consult a healthcare professional.
9
10## 📝 Training Hyperparameters
11- Preprocessing: Lowercasing, tokenisation, stopword removal
12- Training Framework: Hugging Face transformers
13- Training Regime: fp32 (full precision training for stability)
14- Batch Size: 16
15- Learning Rate: 3e-5
16- Epochs: 5
17- Optimiser: AdamW
18- Scheduler: Linear with warmup
19
20## ⏱ Speeds, Sizes, Times
21- Model Checkpoint Size: 4.5GB
22- Training Duration: ~3-4 hours on Google Colab
23- Throughput: 1200 samples per minute
24
25## 🧪 Evaluation
26- Testing Data, Factors & Metrics
27- Testing Data
28- Dataset: MedText (1.4k samples)
29- Dataset Type: Medical symptom descriptions → condition prediction
30
31## Splits:
32- Train: 80% (1,120 cases)
33- Test: 20% (280 cases)
34
35## Metrics
36- Accuracy: 96.5% (measures overall correctness)
37- F1-Score: 95.1% (harmonic mean of precision & recall)
38- Precision: 94.7% (correct condition predictions out of all predicted)
39- Recall: 95.5% (correct condition predictions out of all actual)
40
41## 📊 Results
42- Metric Score
43- Accuracy 96.5%
44- F1-Score 95.1%
45- Precision 94.7%
46- Recall 95.5%
47
48## Summary
49- Strengths: High recall ensures most conditions are correctly identified.
50- Weaknesses: Model might struggle with rare conditions due to dataset limitations.
51
52## ⚙️ Model Architecture & Objective
53- Architecture: BERT (bert-base-uncased) fine-tuned for medical text classification.
54- Objective: Predict potential conditions/outcomes based on patient symptom descriptions.
55
56💻 Compute Infrastructure
57Hardware
58- Training: Google Colab (NVIDIA T4 GPU, 16GB RAM)
59- Inference: Hugging Face Inference API (optimised for CPU/GPU use)
60
61Software
62- Python Version: 3.8
63- Deep Learning Framework: PyTorch (transformers library)
64- Tokeniser: BERT WordPiece Tokenizer
65- Preprocessing Libraries: nltk, spacy, textacy
66
67