Odunsegun/Grammar-corrector

An AI-powered web application for real-time grammar correction, spell checking, and text summarization. Built with Flask, TextBlob, LanguageTool, and Transformers, this tool helps users clean up and refine their writing with ease. Users can type or upload documents, get corrections instantly, and even download fixed versions.

Python

1

6 commits

updated Jul 10, 2025

See the code

README

πŸ“ GrammarCorrector

GrammarCorrector is a Flask-based web application that provides real-time grammar and spell correction for text input or uploaded documents. Powered by NLP models, it highlights mistakes, corrects them, and can even summarize content.


πŸš€ Features

  • βœ… Grammar correction (using HuggingFace transformers)
  • βœ… Spell correction (via language_tool_python)
  • βœ… Document upload support
  • βœ… Live text correction as you type
  • βœ… Mistake count and listing
  • βœ… Dark mode UI with Bootstrap
  • βœ… Summarization mode
  • βœ… Download corrected version

πŸ–Ό UI Preview

App Screenshot


πŸ›  Technologies

  • Python 3.9
  • Flask
  • HuggingFace Transformers
  • LanguageTool
  • Bootstrap 5
  • Torch

πŸ“‚ Project Structure

GrammarCorrector/ β”‚ β”œβ”€β”€ app.py # Flask main entry β”œβ”€β”€ Model.py # Handles correction logic β”œβ”€β”€ corrector.py # Loads and runs transformer model β”œβ”€β”€ templates/ β”‚ └── index.html # Bootstrap frontend β”œβ”€β”€ static/ # Optional: for CSS/JS (if expanded) β”œβ”€β”€ venv/ # Virtual environment (excluded from git) β”œβ”€β”€ .gitignore └── README.md


πŸ“¦ Installation

πŸ”§ Step 1: Clone the repo

git clone https://github.com/Odunsegun/GrammarCorrector.git
cd GrammarCorrector

### πŸ§ͺ Step 2: Create virtual environment

python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate

### πŸ“₯ Step 3: Create virtual environment

pip install -r requirements.txt

### Run the app

python app.py
Visit http://127.0.0.1:5000 in your browser.

πŸ“ Sample Input
Type or upload:

nginx
Copy
Edit
she no went to the market
Output:

Spelling: She did not go to the market

Grammar: She didn't go to the market

Mistakes: ['she no β†’ she did not', 'went β†’ go']

🧠 Future Improvements
Add multi-language support

Optimize performance with caching

Export corrections to PDF/Word

Add AI feedback suggestions


πŸ§‘β€πŸ’» Author
Israel Odunsegun


⚠️ Disclaimer
Large NLP models may result in slower performance on local machines. To avoid this:

Optimize by using lightweight models

Run on GPU or deploy to cloud platforms like HuggingFace Spaces, Streamlit, or Render

Odunsegun/Grammar-corrector

An AI-powered web application for real-time grammar correction, spell checking, and text summarization. Built with Flask, TextBlob, LanguageTool, and Transformers, this tool helps users clean up and refine their writing with ease. Users can type or upload documents, get corrections instantly, and even download fixed versions.

Python

1

6 commits

updated Jul 10, 2025

See the code

README

πŸ“ GrammarCorrector

GrammarCorrector is a Flask-based web application that provides real-time grammar and spell correction for text input or uploaded documents. Powered by NLP models, it highlights mistakes, corrects them, and can even summarize content.


πŸš€ Features

  • βœ… Grammar correction (using HuggingFace transformers)
  • βœ… Spell correction (via language_tool_python)
  • βœ… Document upload support
  • βœ… Live text correction as you type
  • βœ… Mistake count and listing
  • βœ… Dark mode UI with Bootstrap
  • βœ… Summarization mode
  • βœ… Download corrected version

πŸ–Ό UI Preview

App Screenshot


πŸ›  Technologies

  • Python 3.9
  • Flask
  • HuggingFace Transformers
  • LanguageTool
  • Bootstrap 5
  • Torch

πŸ“‚ Project Structure

GrammarCorrector/ β”‚ β”œβ”€β”€ app.py # Flask main entry β”œβ”€β”€ Model.py # Handles correction logic β”œβ”€β”€ corrector.py # Loads and runs transformer model β”œβ”€β”€ templates/ β”‚ └── index.html # Bootstrap frontend β”œβ”€β”€ static/ # Optional: for CSS/JS (if expanded) β”œβ”€β”€ venv/ # Virtual environment (excluded from git) β”œβ”€β”€ .gitignore └── README.md


πŸ“¦ Installation

πŸ”§ Step 1: Clone the repo

git clone https://github.com/Odunsegun/GrammarCorrector.git
cd GrammarCorrector

### πŸ§ͺ Step 2: Create virtual environment

python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate

### πŸ“₯ Step 3: Create virtual environment

pip install -r requirements.txt

### Run the app

python app.py
Visit http://127.0.0.1:5000 in your browser.

πŸ“ Sample Input
Type or upload:

nginx
Copy
Edit
she no went to the market
Output:

Spelling: She did not go to the market

Grammar: She didn't go to the market

Mistakes: ['she no β†’ she did not', 'went β†’ go']

🧠 Future Improvements
Add multi-language support

Optimize performance with caching

Export corrections to PDF/Word

Add AI feedback suggestions


πŸ§‘β€πŸ’» Author
Israel Odunsegun


⚠️ Disclaimer
Large NLP models may result in slower performance on local machines. To avoid this:

Optimize by using lightweight models

Run on GPU or deploy to cloud platforms like HuggingFace Spaces, Streamlit, or Render