Downloads · 30 days
11
2% of all-time downloads
elvisbakunzi/dyslexia-friendly-text-simplifier
dyslexia-friendly-text-simplifier is a machine learning model from elvisbakunzi. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned BART model specifically designed to simplify educational content for students with dyslexia. It transforms complex academic text into clear, accessible language while maintaining educational…
Downloads · 30 days
11
2% of all-time downloads
All-time downloads
704
Public
Parameters
139M
558 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors558 MB · 100%
From the Hugging Face model README
This model is a fine-tuned BART model specifically designed to simplify educational content for students with dyslexia. It transforms complex academic text into clear, accessible language while maintaining educational value and accuracy.
from transformers import BartForConditionalGeneration, BartTokenizer
import torch
# Load model and tokenizer
model = BartForConditionalGeneration.from_pretrained("elvisbakunzi/dyslexia-friendly-text-simplifier")
tokenizer = BartTokenizer.from_pretrained("elvisbakunzi/dyslexia-friendly-text-simplifier")
# Auto-detect device (MPS for Apple Silicon, CUDA for GPU, CPU fallback)
device = torch.device("mps") if torch.backends.mps.is_available() else torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
model.to(device)
def simplify_text(text, max_length=256):
inputs = tokenizer(text, max_length=512, truncation=True, return_tensors='pt').to(device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_length=max_length,
num_beams=3,
length_penalty=0.8,
early_stopping=True,
no_repeat_ngram_size=2
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Example usage
complex_text = "The derivative represents the instantaneous rate of change of a function."
simplified = simplify_text(complex_text)
print(simplified)
# Output: "The derivative shows the immediate rate of change of a function."
Input: "To solve linear equations of the form ax + b = c, where a, b, and c are constants, we must isolate the variable x through systematic algebraic manipulation."
Output: "To solve equations like ax + b = c, we need to get x by itself. We do this by doing opposite operations."
Input: "Cellular organelles perform specialized functions essential for maintaining cellular homeostasis and metabolic processes."
Output: "Cell parts do special jobs to keep cells healthy and balanced."
Input: "The protagonist's psychological transformation throughout the narrative demonstrates the author's sophisticated understanding of human nature."
Output: "The main character changes during the story. This shows the author understands how people think and feel."
from flask import Flask, request, jsonify
from transformers import BartForConditionalGeneration, BartTokenizer
app = Flask(__name__)
model = BartForConditionalGeneration.from_pretrained("elvisbakunzi/dyslexia-friendly-text-simplifier")
tokenizer = BartTokenizer.from_pretrained("elvisbakunzi/dyslexia-friendly-text-simplifier")
@app.route('/simplify', methods=['POST'])
def simplify():
data = request.get_json()
text = data['text']
# ... simplification logic
return jsonify({"simplified": simplified_text})
# For production use with caching and optimization
import torch
from functools import lru_cache
class DyslexiaFriendlySimplifier:
def __init__(self):
self.model = BartForConditionalGeneration.from_pretrained("elvisbakunzi/dyslexia-friendly-text-simplifier")
self.tokenizer = BartTokenizer.from_pretrained("elvisbakunzi/dyslexia-friendly-text-simplifier")
self.device = torch.device("mps") if torch.backends.mps.is_available() else torch.device("cpu")
self.model.to(self.device)
self.model.eval()
@lru_cache(maxsize=100)
def simplify(self, text):
# Implementation with caching for repeated requests
pass
The model was evaluated on dyslexia-specific metrics:
If you use this model and have suggestions for improvement:
Apache 2.0 - Feel free to use in educational and commercial applications.
If you use this model in your research or application, please cite:
@misc{dyslexia-friendly-text-simplifier-2025,
title={Dyslexia-Friendly Text Simplifier: BART-based Educational Content Simplification},
author={Elvis Guy Bakunzi},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/elvisbakunzi/dyslexia-friendly-text-simplifier}
}
For questions, issues, or collaboration opportunities, please reach out through the model repository discussions.
This model was developed to make educational content more accessible for students with dyslexia and other reading differences. Every student deserves access to quality education.