- Tried to implement it with a shortcut (Cmd + Control + C) - the Python way of working with MacOS keyboard permissions was less than ideal and I'll probably rewrite it to Swift one day, since it appears to have much more straightforward access policies.
- Choosing the model took some time - the Grammarly's was the first one that was actually reliable, even though it needed fine-tuning (it kept adding a lot of stuff like emoticons)
- The .cursorrules created here will probably be a good baseline for future ML projects
- It also required some polishing of the prompt - too harsh and the answers were empty, too lax and there were no corrections
- Paid models like Gemini Pro Max (0.05$ per prompt) actually weren't much more helpful, and they actually generated "test" scripts that didn't even compile :) a dollar terribly spent
A macOS menubar application that corrects English text grammar on the fly using AI language models. Simply copy text, click the menubar icon to correct it, and paste the corrected version.
- Grammar correction using Grammarly's coedit-large model
- Accessible from the menu bar
- No internet required - runs completely offline
- Preserves clipboard content
- Simple mode for straightforward corrections
- Works across all macOS applications
- Minimal RAM and CPU usage when idle
- Runs natively on Apple Silicon (M1/M2/M3)
- Copy text from any application
- Click the checkmark icon (✓) in the menu bar and select "Correct Clipboard"
- Paste the corrected text where needed
- Receive notifications indicating if text was corrected
- Correct Clipboard: Manually trigger correction
- Minimal Corrections: Toggle between minimal and standard correction modes
- Simple Mode: Toggle clipboard preservation mode
- Settings: Configure the application behavior
The application uses a local language model to correct grammar and improve text readability. The model is loaded into memory when the app starts and runs locally on your machine without sending any data to external servers.
- Model Loading Issues: If the model fails to load, try running
python3 download_model.pyagain to re-download it - Notifications Not Showing: Check macOS notification settings for the app
- Download the latest release from the Releases page
- Unzip the downloaded file
- Move Text Corrector.app to your Applications folder
- Open the app (right-click and select "Open" the first time to bypass Gatekeeper)
- Grant the necessary permissions when prompted
-
Clone this repository:
git clone https://github.com/ppuzio/text-corrector.git cd text-corrector -
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt -
Download the model:
python3 download_model.py -
Run the application:
python3 app.py -
(Optional) Build a standalone app:
python3 setup.py py2appand run it using
./dist/TextCorrector.app/Contents/MacOS/TextCorrectorThe app will be available in the
distfolder.
- Python 3.9+
- Dependencies listed in requirements.txt
- macOS 10.15+ supported
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
- Grammarly for their open-source language models
- The Hugging Face team for transformers library
- Apple for MPS acceleration on Apple Silicon