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.
CODEBLOCK0
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.
CODEBLOCK2
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:
CODEBLOCK3
- 2. Auto-fix safe replacements:
CODEBLOCK4
- 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 - INLINECODE2 — promotional language to flag
- INLINECODE3 — phrase → replacement mappings (empty string = delete)
- INLINECODE4 — phrases to auto-remove
- INLINECODE5 — excessive hedging to flag
Batch Processing
Process multiple files:
CODEBLOCK6
Humanize CLI
用于检测和自动修复AI写作模式的命令行工具。
脚本
analyze.py — 检测AI模式
扫描文本并报告AI词汇、浮夸用语、聊天机器人痕迹以及可自动替换的短语。
bash
分析文件
python scripts/analyze.py input.txt
从标准输入分析
echo 这证明了我们的承诺 | python scripts/analyze.py
用于程序化处理的JSON输出
python scripts/analyze.py input.txt --json
输出示例:
==================================================
AI模式分析 - 发现5个问题
==================================================
AI词汇:
• 证明:1次
• 至关重要:2次
可自动替换:
• 作为 → 是:1次
• 为了 → 以:1次
humanize.py — 自动替换模式
对常见的AI用语进行自动替换。
bash
人性化处理并输出到标准输出
python scripts/humanize.py input.txt
写入输出文件
python scripts/humanize.py input.txt -o output.txt
包含破折号替换
python scripts/humanize.py input.txt --fix-dashes
静默模式(无变更日志)
python scripts/humanize.py input.txt -q
自动修复的内容:
- - 填充短语:为了 → 以,由于 → 因为
- 系动词回避:作为 → 是,拥有 → 有
- 句子开头:删除此外,、而且,、再者,
- 弯引号 → 直引号
- 聊天机器人痕迹:删除希望这有帮助、如有疑问请等
工作流程
- 1. 先分析,查看需要修复的内容:
bash
python scripts/analyze.py document.txt
- 2. 自动修复安全替换:
bash
python scripts/humanize.py document.txt -o document_clean.txt
- 3. 手动审查分析标记的AI词汇和浮夸用语(这些需要人工判断)
- 4. 重新分析,确认改进效果:
bash
python scripts/analyze.py document_clean.txt
自定义模式
编辑 scripts/patterns.json 以添加/删除:
- - aiwords — 标记但不自动替换的词汇
- puffery — 需要标记的宣传性语言
- replacements — 短语 → 替换映射(空字符串表示删除)
- chatbotartifacts — 自动删除的短语
- hedging_phrases — 需要标记的过度模糊表达
批量处理
处理多个文件:
bash
分析所有markdown文件
for f in *.md; do
echo === $f ===
python scripts/analyze.py $f
done
原地处理所有txt文件
for f in *.txt; do
python scripts/humanize.py $f -o $f.tmp && mv $f.tmp $f
done