05 · NLP · DEPLOYMENT
Grammar & Spell Checker
Repository codename · NLP Correction App
A Flask application that repairs grammar and spelling using transformer models, containerised so the model environment behaves identically on every machine it lands on.
01 — THE PROBLEM
Rule-based spell checkers fix typos but cannot see that a sentence is ungrammatical. Language models fix grammar but are heavy and fussy to install — and the usual outcome is a project that works on the machine it was written on and nowhere else.
This project pairs both approaches, then removes the environment problem entirely by shipping the whole thing as an image.
02 — ARCHITECTURE
Input text → TextBlob (spelling) → Transformer model (grammar) → Corrected output
↑
Torch backend, inside Docker03 — BUILD LOG
The decisions that shaped the system, and why each one was made.
-
Two layers, because they fail differently
TextBlob handles spelling, where a dictionary is exactly the right tool. A Hugging Face transformer running on Torch handles grammar, where context is required. Each one covers the other's blind spot, instead of asking a single component to do everything.
-
Docker as the actual feature
A Dockerfile pins Python 3.10 and the full model environment, so
docker runis the entire install procedure. For an NLP app with Torch in the dependency tree, reproducibility is not a nicety — it is the difference between a usable project and a README full of caveats. -
A swappable model
The correction model sits behind
Model.pyrather than being inlined into the Flask routes, so it can be exchanged or fine-tuned for domain-specific grammar rules without touching the web layer. -
Honest about production
Debug mode is enabled for development only, and the developer notes call for Gunicorn or uWSGI in front of the app before it faces real traffic — documented rather than silently shipped as-is.
04 — WALKTHROUGH
Running it end to end.
-
Build the image
docker build -t grammar-spell-checker . -
Run the container
docker run -p 5000:5000 grammar-spell-checker -
Open it
http://localhost:5000 -
Try the sample
A single sentence carrying four separate errors — verb agreement, a double negative, a countability mistake and tense.
Input: He dont has no idea how many informations was missing from the report. Output: He doesn't have any idea how much information was missing from the report.
05 — STACK