DyslexiaLens is an AI-powered web application designed to make text more accessible for individuals with dyslexia. Utilizing advanced Natural Language Processing (NLP) techniques and computer vision, DyslexiaLens transforms and adapts text to improve readability and comprehension.
- Text Simplification: Converts complex text to dyslexia-friendly formats using advanced NLP
- Multi-format Support: Processes text from various sources including PDFs and images
- OCR Integration: Extracts text from images using Tesseract OCR and OpenCV
- Readability Analysis: Provides comprehensive readability scoring and assessment
- AI Enhancement: Uses Google's Gemini AI for intelligent text refinement
- User-friendly Interface: Clean, accessible web interface built with Next.js
- File Upload Support: Upload PDFs and images for text extraction and simplification
- Next.js - React framework for the user interface
- React - Component-based UI library
- Tailwind CSS - Utility-first CSS framework
- FastAPI - Modern, fast web framework for building APIs
- Python - Core backend language
- Natural Language Processing:
- NLTK - Natural language toolkit for text processing
- spaCy - Advanced NLP library for linguistic analysis
- TextStat - Library for readability statistics
- Computer Vision & OCR:
- OpenCV - Computer vision library for image processing
- Tesseract OCR - Optical character recognition engine
- Pillow (PIL) - Python imaging library
- AI Integration:
- Google Generative AI (Gemini) - Advanced language model for text enhancement
- File Processing:
- PDFPlumber - PDF text extraction
- python-multipart - File upload handling
- Text Processing:
- ftfy - Text encoding and cleanup
- regex (re) - Pattern matching and text manipulation
DyslexiaLens/
├── frontend/ # Next.js application
│ ├── src/
│ ├── public/
│ ├── package.json
│ └── ...
├── backend/ # Python FastAPI application
│ ├── main.py # Main application file
│ ├── requirements.txt
│ └── ...
└── README.md
- Node.js (version 14 or higher recommended)
- npm, yarn, pnpm, or bun
- Python 3.8 or higher
- pip (Python package manager)
- Tesseract OCR installed on your system
git clone https://github.com/prathoseraaj/DyslexiaLens.git
cd DyslexiaLenscd backend
pip install -r requirements.txtRequired Python packages:
- fastapi
- uvicorn
- python-multipart
- pydantic
- ftfy
- nltk
- spacy
- textstat
- google-generativeai
- python-dotenv
- pytesseract
- pillow
- pdfplumber
- opencv-python
Additional Setup:
- Install Tesseract OCR on your system
- Download spaCy English model:
python -m spacy download en_core_web_sm - Create a
.envfile with your Gemini API key:gemini_api_key=your_api_key_here
cd frontend
npm install
# or yarn install / pnpm install / bun installcd backend
uvicorn main:app --reload --host 0.0.0.0 --port 8000The API will be available at http://localhost:8000.
cd frontend
npm run dev
# or yarn dev / pnpm dev / bun devThe application will be available at http://localhost:3000.
- POST /simplif - Simplify text input
- POST /upload - Upload and process PDF/image files
- GET / - Health check endpoint
- Text Input: Paste or type text directly into the application
- File Upload: Upload PDF files or images containing text
- Processing: The application will:
- Extract text (if from file)
- Analyze readability and complexity
- Apply lexical simplification
- Break down long sentences
- Enhance with AI-powered refinement
- Results: View the dyslexia-friendly adapted text with readability improvements
- Text Cleaning: Fixes encoding issues and normalizes formatting
- Segmentation: Breaks text into paragraphs, sentences, and tokens
- Readability Analysis: Calculates various readability scores (Flesch-Kincaid, SMOG, etc.)
- Issue Detection: Identifies long sentences, passive voice, and ambiguous structures
- Lexical Simplification: Replaces complex words with simpler alternatives
- Sentence Splitting: Breaks long sentences into shorter, clearer ones
- AI Enhancement: Uses Gemini AI for final refinement while preserving meaning
- PDF: Extracts text using PDFPlumber
- Images (PNG, JPEG, JPG): Uses Tesseract OCR with OpenCV preprocessing
This project is licensed under the Apache License 2.0.
Contributions are welcome! Please feel free to submit a Pull Request.
For questions or suggestions, please open an issue or contact the maintainer.
DyslexiaLens – Smart AI that reshapes text for dyslexic readers using advanced NLP and computer vision.