Ghostwriter is a 100% local, no-login web app that learns your writing style and helps you evaluate and rewrite text to match it.
Zero setup required! A fully static version is available in the docs/ directory and hosted via GitHub Pages.
- URL: Visit the live version at your GitHub Pages site (or run locally: see below)
- No backend: Everything runs 100% in your browser
- No server upload: Your writing samples never leave your device — stored only in localStorage
- No dependencies: Pure HTML, CSS, and JavaScript (+ Chart.js for visualization)
To run locally:
cd docs/
python -m http.server 8123
# Visit http://localhost:8123 in your browserOr open docs/index.html directly in your browser (modern browsers support ES modules over file:// in some cases; a local server is safer).
The static version includes:
- All 4 core pages: Train, Score, Rewrite, Profiles
- Same dark violet theme and UI as the Python version
- Full fingerprinting, scoring, and rewriting (deterministic — same input always gives same output)
- localStorage-based profile storage (per-browser, private)
- Pre-computed English vocabulary frequency data (
docs/data/wordfreq_en.json)
- No vocabulary substitution: WordNet (WordNet) is not available in the browser. The rewriter omits this transform; all other 5 transforms (sentence splits/merges, contractions, punctuation, fillers, capitalization) are fully ported.
- No multi-language support: Currently English only.
- Train — Paste writing samples to build a "fingerprint" of your style
- Score — Check how much any text sounds like you (0-100 match score)
- Rewrite — Transform AI-generated or other text to match your style (with aggressiveness slider)
- Profiles — Manage multiple writing profiles (e.g., essays, casual, professional)
- No cloud, no APIs, no login — Everything runs locally on your machine
- Pure statistical NLP — Uses nltk and wordfreq for style analysis
- Fast and lightweight — Flat JSON file storage, minimal dependencies
- Deterministic — Same input always produces the same output
- Beautiful UI — Dark modern theme with electric violet accents
Each writing sample is analyzed across:
- Sentence Length — Average words per sentence + variance
- Vocabulary Rarity — How uncommon/sophisticated your words are
- Punctuation Tics — Your use of ellipses, dashes, exclamation marks, commas, semicolons
- Filler Words — Frequency of "like," "basically," "honestly," etc.
- Contractions — How often you use "don't," "I'm," etc.
- Paragraph Rhythm — Average sentences per paragraph
- Capitalization — Whether you consistently capitalize sentence starts
The "You Score" is a 0-100 match on all dimensions combined. The app also shows which dimensions diverge most from your style.
- Python 3.11+
- pip
# Clone or cd into the ghostwriter directory
cd ghostwriter
# Create a virtual environment (optional but recommended)
python -m venv .venv
source .venv/bin/activate # on Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# First run: nltk data is auto-downloaded
python app.pyThe app will automatically download required NLTK data (punkt, wordnet, stopwords) on first run.
Visit http://localhost:5000 in your browser.
- Go to
/train - Enter a profile name (e.g., "Personal", "Essays")
- Paste a writing sample (500+ words recommended)
- Submit — your fingerprint is computed and saved
Multiple samples for the same profile are merged together, strengthening the fingerprint.
- Go to
/score - Select a profile
- Paste text you want to score
- See:
- You Score: 0-100 match percentage
- Radar chart: Breakdown by dimension
- Key Differences: Which dimensions diverge most
- Go to
/rewrite - Select a profile
- Paste text (e.g., AI-generated content)
- Adjust the aggressiveness slider (0% = minimal change, 100% = maximum)
- See original and rewritten versions side-by-side
Rewriting is deterministic and statistically sound: it adjusts sentence structure, injects contractions/fillers, tweaks punctuation, etc. to match your style.
- Go to
/profiles - View saved profiles and their detailed fingerprints
- Delete profiles you no longer need
Profiles are stored as JSON in the profiles/ directory.
Extracts numeric features from text using:
- NLTK for tokenization (sentences, words, stopwords)
- wordfreq for vocabulary rarity (Zipf frequency scoring)
- Regex for punctuation and capitalization analysis
Compares input text's fingerprint to a target fingerprint:
- Computes normalized distance for each dimension
- Averages distances → 0-100 overall score
- Reports key divergences in human-readable language
Deterministically transforms text toward a target fingerprint:
- Splits/merges sentences (toward target avg length)
- Injects/removes contractions
- Adds characteristic punctuation
- Inserts filler words
- Adjusts capitalization
- Light vocabulary substitution (WordNet synonyms)
All transforms respect the aggressiveness parameter: higher = more aggressive.
Simple flat-file JSON storage in profiles/ directory. No database needed.
ghostwriter/
├── app.py # Flask routes
├── ghostwriter/
│ ├── fingerprint.py # Style feature extraction
│ ├── scorer.py # Text scoring
│ ├── rewriter.py # Text transformation
│ └── storage.py # JSON persistence
├── templates/ # Jinja HTML
├── static/ # CSS + JS
├── profiles/ # JSON profile storage
└── requirements.txt
- Flask — Web framework
- nltk — Natural language processing (tokenization, WordNet)
- wordfreq — Vocabulary frequency scoring (Zipf)
All are pure Python and work offline.
- Fingerprints are most accurate with 500+ words of input
- Rewriting doesn't understand semantic meaning; it's purely statistical
- Works best on English text (language-specific in wordfreq, NLTK)
- Very long texts may take a few seconds to analyze
- Multi-language support
- Export profiles as shareable JSON
- Batch scoring from file uploads
- Style transfer between profiles
- Voice/audio analysis
MIT
Built with Python, NLTK, and a love for good writing.
Ghostwriter: Know your voice. Own your style.