Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
tags:
|
| 4 |
+
- medical
|
| 5 |
+
- pediatrics
|
| 6 |
+
- mobilebert
|
| 7 |
+
- question-answering
|
| 8 |
+
license: apache-2.0
|
| 9 |
+
datasets:
|
| 10 |
+
- custom
|
| 11 |
+
model-index:
|
| 12 |
+
- name: MobileBERT Nelson Pediatrics
|
| 13 |
+
results: []
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# MobileBERT Fine-tuned on Nelson Textbook of Pediatrics
|
| 17 |
+
|
| 18 |
+
This model is a fine-tuned version of `google/mobilebert-uncased` trained on excerpts from the **Nelson Textbook of Pediatrics**. It is designed to serve as a lightweight, on-device capable medical assistant model for pediatric reference tasks.
|
| 19 |
+
|
| 20 |
+
## Intended Use
|
| 21 |
+
|
| 22 |
+
This model is intended for:
|
| 23 |
+
|
| 24 |
+
- Medical question answering (focused on pediatrics)
|
| 25 |
+
- Clinical decision support in low-resource environments
|
| 26 |
+
- Integration into apps like **Nelson-GPT** for fast inference
|
| 27 |
+
|
| 28 |
+
> **Note:** This model is for educational and experimental use only and should not replace professional medical advice.
|
| 29 |
+
|
| 30 |
+
## Training Details
|
| 31 |
+
|
| 32 |
+
- Base model: `mobilebert-uncased`
|
| 33 |
+
- Training framework: Transformers + PyTorch
|
| 34 |
+
- Dataset: Nelson Textbook (manually curated excerpts)
|
| 35 |
+
- Epochs: [insert]
|
| 36 |
+
- Learning rate: [insert]
|
| 37 |
+
|
| 38 |
+
## How to Use
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
|
| 42 |
+
import torch
|
| 43 |
+
|
| 44 |
+
tokenizer = AutoTokenizer.from_pretrained("drzeeIslam/mobilebert-nelson")
|
| 45 |
+
model = AutoModelForQuestionAnswering.from_pretrained("drzeeIslam/mobilebert-nelson")
|
| 46 |
+
|
| 47 |
+
question = "What is the treatment for nephrotic syndrome?"
|
| 48 |
+
context = "The first-line treatment for nephrotic syndrome in children is corticosteroid therapy..."
|
| 49 |
+
|
| 50 |
+
inputs = tokenizer(question, context, return_tensors="pt")
|
| 51 |
+
outputs = model(**inputs)
|
| 52 |
+
|
| 53 |
+
start = torch.argmax(outputs.start_logits)
|
| 54 |
+
end = torch.argmax(outputs.end_logits) + 1
|
| 55 |
+
|
| 56 |
+
answer = tokenizer.convert_tokens_to_string(tokenizer.convert_ids_to_tokens(inputs['input_ids'][0][start:end]))
|
| 57 |
+
print(answer)
|