Source Code
Humanize CLI
Command-line tools for detecting and auto-fixing AI writing patterns.
Scripts
analyze.py โ Detect AI Patterns
Scans text and reports AI vocabulary, puffery, chatbot artifacts, and auto-replaceable phrases.
# Analyze a file
python scripts/analyze.py input.txt
# Analyze from stdin
echo "This serves as a testament to our commitment" | python scripts/analyze.py
# JSON output for programmatic use
python scripts/analyze.py input.txt --json
Output example:
==================================================
AI PATTERN ANALYSIS - 5 issues found
==================================================
AI VOCABULARY:
โข testament: 1x
โข crucial: 2x
AUTO-REPLACEABLE:
โข "serves as" โ "is": 1x
โข "in order to" โ "to": 1x
humanize.py โ Auto-Replace Patterns
Performs automatic replacements for common AI-isms.
# Humanize and print to stdout
python scripts/humanize.py input.txt
# Write to output file
python scripts/humanize.py input.txt -o output.txt
# Include em dash replacement
python scripts/humanize.py input.txt --fix-dashes
# Quiet mode (no change log)
python scripts/humanize.py input.txt -q
What it fixes automatically:
- Filler phrases: "in order to" โ "to", "due to the fact that" โ "because"
- Copula avoidance: "serves as" โ "is", "boasts" โ "has"
- Sentence starters: removes "Additionally,", "Furthermore,", "Moreover,"
- Curly quotes โ straight quotes
- Chatbot artifacts: removes "I hope this helps", "Let me know if", etc.
Workflow
Analyze first to see what needs fixing:
python scripts/analyze.py document.txtAuto-fix safe replacements:
python scripts/humanize.py document.txt -o document_clean.txtManual review for AI vocabulary and puffery flagged by analyze (these require human judgment)
Re-analyze to confirm improvements:
python scripts/analyze.py document_clean.txt
Customizing Patterns
Edit scripts/patterns.json to add/remove:
ai_wordsโ vocabulary that flags but doesn't auto-replacepufferyโ promotional language to flagreplacementsโ phrase โ replacement mappings (empty string = delete)chatbot_artifactsโ phrases to auto-removehedging_phrasesโ excessive hedging to flag
Batch Processing
Process multiple files:
# Analyze all markdown files
for f in *.md; do
echo "=== $f ==="
python scripts/analyze.py "$f"
done
# Humanize all txt files in place
for f in *.txt; do
python scripts/humanize.py "$f" -o "$f.tmp" && mv "$f.tmp" "$f"
done