Downloads · 30 days
9
12% of all-time downloads
Abduull6771/mt5-en-ha-healthcare
mt5-en-ha-healthcare is a translation model from Abduull6771. Use it when you need text moved from one language to another. The card lists the license as apache-2.0.
This model is a fine-tuned version of google/mt5-small specifically trained for English-to-Hausa translation in healthcare contexts. The model has been optimized for medical terminology, patient-doctor interactions, t…
Downloads · 30 days
9
12% of all-time downloads
All-time downloads
75
Public
Parameters
300M
3.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt2.4 GB · 50%
From the Hugging Face model README
This model is a fine-tuned version of google/mt5-small specifically trained for English-to-Hausa translation in healthcare contexts. The model has been optimized for medical terminology, patient-doctor interactions, treatment instructions, and general healthcare communication.
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Load model and tokenizer
model_name = "Abduull6771/mt5-en-ha-healthcare"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
# Translate text
def translate_to_hausa(text):
input_text = f"translate English to Hausa: {text}"
inputs = tokenizer(input_text, return_tensors="pt", max_length=256, truncation=True)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_length=256,
num_beams=4,
early_stopping=True,
do_sample=False
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Example usage
english_text = "The patient has high blood pressure and needs medication."
hausa_translation = translate_to_hausa(english_text)
print(hausa_translation)
from flask import Flask, request, jsonify
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
app = Flask(__name__)
# Load model once at startup
model = AutoModelForSeq2SeqLM.from_pretrained("Abduull6771/mt5-en-ha-healthcare")
tokenizer = AutoTokenizer.from_pretrained("Abduull6771/mt5-en-ha-healthcare")
@app.route('/translate', methods=['POST'])
def translate():
data = request.json
english_text = data['text']
input_text = f"translate English to Hausa: {english_text}"
inputs = tokenizer(input_text, return_tensors="pt", max_length=256, truncation=True)
outputs = model.generate(**inputs, max_length=256, num_beams=4, early_stopping=True)
translation = tokenizer.decode(outputs[0], skip_special_tokens=True)
return jsonify({'translation': translation, 'status': 'success'})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
The model was trained on a curated dataset of healthcare-related English-Hausa sentence pairs covering:
| English | Hausa |
|---|---|
| "Take this medicine twice daily" | "Ɗauki wannan magani sau biyu a rana" |
| "The patient has high blood pressure" | "Majinyaci yana da hawan jini" |
| "Please come back next week" | "Don Allah ku dawo mako mai zuwa" |
| "Children need vaccination" | "Yara suna bukatar rigakafi" |
If you use this model in your research or applications, please cite:
@misc{mt5-en-ha-healthcare,
title={English-to-Hausa Healthcare Translation Model},
author={Healthcare Translation Project},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/Abduull6771/mt5-en-ha-healthcare}
}
This model is released under the Apache 2.0 License. See LICENSE for more details.
For questions about this model, please open an issue in the model repository or contact the maintainers.
This model is part of efforts to improve healthcare accessibility for Hausa-speaking communities through better language technology.