mclanorjeff/prn-nurse-maternal-health-mt5-twi-english
Ghana Maternal Health mT5 Twi-English
This model is a fine-tuned google/mt5-small text-to-text model for Ghana maternal-health question answering in a Twi-English code-mixed setting.
Intended Use
The model is intended for educational maternal-health support and prototype development. It can be used to generate English maternal-health responses from English or Twi-English code-mixed questions.
Recommended workflow:
- Check for urgent danger signs.
- Retrieve a verified maternal-health answer from a curated Q&A source.
- Optionally use this model to rephrase the response.
- Tell the user to consult a nurse, midwife, doctor, or health facility when needed.
Training Data
Dataset: Ghana Maternal Health Twi-English Q&A Dataset
Dataset structure:
question: Twi-English code-mixed maternal-health questionquestion_english: English version of the questionanswer: English answermetadata: topic, stage, setting, urgency, and keywords
The model was trained on the code-mixed question as input and the English answer as output.
Training Summary
Metric progression:
Usage
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
import torch
model_id = "mclanorjeff/prn-nurse-maternal-health-mt5-twi-english"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device)
question = "When should I start breastfeeding after delivery?"
prompt = (
"Answer this maternal health question clearly and safely. "
"Language: twi_english_code_mixed.\n"
f"Question: {question}\n"
"Answer:"
)
inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=256).to(device)
outputs = model.generate(**inputs, max_new_tokens=160, num_beams=4)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))Example Prompt
Answer this maternal health question clearly and safely. Language: twi_english_code_mixed.
Question: Me ho yɛ me sɛ mebɛfe every morning. Is it normal?
Answer:Gradio Space
A Gradio demo can load this model with transformers and expose a simple question-answer interface. The recommended demo includes a safety pre-check for danger signs before model generation.
Limitations and Safety
This model is not a doctor, nurse, midwife, or diagnostic system. It should not be used as a standalone medical chatbot.
Local testing showed that the model can sometimes produce fluent but wrong-topic answers. For safer real-world use, combine it with:
- retrieval from verified Q&A records,
- danger-sign detection,
- human clinical review,
- clear advice to seek professional care.
Urgent symptoms such as bleeding, severe headache, fever, convulsions, severe abdominal pain, trouble breathing, swollen face/hands, or reduced baby movement require immediate professional care. In Ghana, emergency help may be available via 112 or 193.
