โ† Back to AI & LLMs
AI & LLMs by @artur-zhdan

humanize-ai

Humanize AI content by detecting and auto-fixing AI generated

0
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

  1. Analyze first to see what needs fixing:

    python scripts/analyze.py document.txt
    
  2. Auto-fix safe replacements:

    python scripts/humanize.py document.txt -o document_clean.txt
    
  3. Manual review for AI vocabulary and puffery flagged by analyze (these require human judgment)

  4. 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-replace
  • puffery โ€” promotional language to flag
  • replacements โ€” phrase โ†’ replacement mappings (empty string = delete)
  • chatbot_artifacts โ€” phrases to auto-remove
  • hedging_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