Humanize Chinese AI Text
Comprehensive CLI for detecting and transforming Chinese AI-generated text. Makes robotic AI writing natural and human-like with 6 specialized writing style transforms.
NEW in v1.1: Style transforms (知乎/小红书/公众号/口语化/学术/文艺), enhanced detection (16 patterns), emotional analysis
Quick Start
# Detect AI patterns (16 categories)
python scripts/detect_cn.py text.txt
# Humanize text
python scripts/humanize_cn.py text.txt -o clean.txt
# Scene-specific humanization
python scripts/humanize_cn.py text.txt --scene social # Social media
python scripts/humanize_cn.py text.txt --scene tech # Tech blog
python scripts/humanize_cn.py text.txt --scene formal # Formal article
# NEW: Apply writing styles
python scripts/humanize_cn.py text.txt --style zhihu -o zhihu.txt
python scripts/humanize_cn.py text.txt --style xiaohongshu -o xhs.txt
python scripts/style_cn.py text.txt --style casual -o casual.txt
# List all available styles
python scripts/style_cn.py --list
# Compare before/after
python scripts/compare_cn.py text.txt -o clean.txt
Detection Categories
The analyzer checks for 16 pattern categories specific to Chinese AI text (v1.1 added 4 new patterns):
Critical (Immediate AI Detection)
| Category |
Examples |
| Three-Part Structure |
首先...其次...最后, 一方面...另一方面 |
| Mechanical Connectors |
值得注意的是, 综上所述, 不难发现 |
| Empty Grand Words |
赋能, 闭环, 智慧时代, 数字化转型 |
High Signal
| Category |
Examples |
| AI High-Frequency Words |
助力, 彰显, 凸显, 焕发, 深度剖析 |
| Technical Jargon Misuse |
解构, 量子纠缠, 光谱 (in non-tech context) |
| Excessive Rhetoric |
对偶句 (>2x), 排比句 (>1x), 引用句 (>4x) |
Medium Signal
| Category |
Examples |
| Punctuation Overuse |
Dense em dashes, excessive semicolons |
| Obscure Metaphors |
Forced, disconnected comparisons |
| Uniform Paragraphs |
Equal-length paragraphs (no rhythm) |
Style Signal
| Category |
Examples |
| Low Burstiness |
Monotonous sentence structure |
| Low Perplexity |
Predictable word choices |
| Emotional Flatness |
NEW Lack of emotional words and expressions |
| Repetitive Structure |
NEW Sentence starters repeat >3 times |
| Slang Overuse |
NEW Internet slang in formal context |
| Vocabulary Homogeneity |
NEW Low diversity in word choice |
Writing Style Transforms (NEW in v1.1)
Transform text into 6 specialized Chinese writing styles:
| Style |
Name |
Description |
Best For |
casual |
口语化风格 |
Like chatting with friends — natural, relaxed |
Social media, messaging |
zhihu |
知乎风格 |
Rational, in-depth, with personal opinions |
Q&A platforms, thoughtful analysis |
xiaohongshu |
小红书风格 |
Enthusiastic, emoji-rich, product-focused |
Lifestyle sharing, reviews, recommendations |
wechat |
公众号风格 |
Storytelling, engaging, relatable |
WeChat articles, newsletters |
academic |
学术风格 |
Rigorous but not stiff, precise terminology |
Academic papers, research reports |
literary |
文艺风格 |
Poetic, imagery-rich, metaphorical |
Creative writing, essays |
Usage
# Apply style directly
python scripts/style_cn.py input.txt --style zhihu -o output.txt
# Combine humanization + style
python scripts/humanize_cn.py ai_text.txt --style xiaohongshu -o natural.txt
# List all styles
python scripts/style_cn.py --list
Style Features
Casual (口语化)
- Removes formal structure (首先/其次/最后)
- Adds colloquial connectors (说实话, 确实, 其实)
- Includes tone particles (吧, 呢, 啊)
- Light emoji usage
Zhihu (知乎)
- Personal opinion markers (从我的经验来看, 个人认为)
- Data/evidence support (实测发现, 根据XX调研)
- Example-driven (举个例子)
- Logical but conversational
Xiaohongshu (小红书)
- Enthusiastic openers (姐妹们!分享一下~)
- High emoji density (😊✨💯)
- Intensifiers (超级, 巨, 绝绝子, yyds)
- Hashtags (#好物分享)
- Short paragraphs
Wechat (公众号)
- Story-driven openings
- Questions for engagement (你有没有想过)
- Relatable scenarios
- Emotional connection
Academic (学术)
- Removes colloquialisms
- Precise terminology
- Formal connectors (研究表明, 数据显示)
- Reduces emotional expressions
Literary (文艺)
- Metaphors and imagery
- Poetic language
- Descriptive phrases (在XX的光影里)
- Artistic expressions
Scripts
detect_cn.py — Scan Chinese AI Patterns
python scripts/detect_cn.py essay.txt
python scripts/detect_cn.py essay.txt -j # JSON output
python scripts/detect_cn.py essay.txt -s # score only
echo "文本" | python scripts/detect_cn.py
Output:
- AI feature statistics (by category)
- AI probability score (low/medium/high/very high)
- Auto-fixable patterns marked
- Perplexity and burstiness indicators
humanize_cn.py — Transform to Human-Like
python scripts/humanize_cn.py essay.txt
python scripts/humanize_cn.py essay.txt -o output.txt
python scripts/humanize_cn.py essay.txt --scene social # Social media style
python scripts/humanize_cn.py essay.txt -a # Aggressive mode
Scene Parameters (--scene):
social: Social media (casual, conversational)
tech: Tech blog (professional but approachable)
formal: Formal article (rigorous but natural)
chat: Chat/dialogue (friendly, concise)
Auto-fixes:
- Remove three-part structure (首先/其次/最后)
- Replace mechanical connectors (值得注意的是 → 注意/要提醒的是)
- Simplify empty words (赋能 → 帮助/提升, 闭环 → 完整流程)
- Reduce punctuation density (em dash, semicolon)
- Control rhetoric frequency (对偶, 排比, 比喻)
Aggressive Mode (-a):
- Add colloquial expressions
- Inject emotional color
- Vary sentence rhythm
- Add personal perspective
compare_cn.py — Before/After Analysis
python scripts/compare_cn.py essay.txt
python scripts/compare_cn.py essay.txt --scene tech -o clean.txt
Shows AI feature comparison and score changes before/after transformation.
style_cn.py — Writing Style Transform (NEW)
python scripts/style_cn.py essay.txt --style zhihu -o essay_zhihu.txt
python scripts/style_cn.py blog.txt --style xiaohongshu -o blog_xhs.txt
python scripts/style_cn.py --list # Show all available styles
Supported styles: casual, zhihu, xiaohongshu, wechat, academic, literary
Transform text into specific Chinese writing styles with style-appropriate vocabulary, tone, and structure.
Workflow
Scan for detection risk:
python scripts/detect_cn.py document.txt
Transform with comparison:
python scripts/compare_cn.py document.txt --scene tech -o document_v2.txt
Verify improvement:
python scripts/detect_cn.py document_v2.txt -s
Manual review for content quality and scene appropriateness
AI Probability Scoring
| Rating |
Criteria |
| Very High |
Three-part structure, mechanical connectors, or empty grand words present |
| High |
>20 issues OR issue density >3% |
| Medium |
>10 issues OR issue density >1.5% |
| Low |
<10 issues AND density <1.5% |
Scene-Specific Guidelines
Social Media (社交媒体)
Style: Casual, conversational, like chatting with friends
- ✅ Short paragraphs (1-3 sentences)
- ✅ Colloquial expressions (说实话, 没想到, 真的绝了)
- ✅ Specific details (product names, locations, personal feelings)
- ✅ Emoji and hashtags
- ❌ Avoid: 值得注意的是, 总而言之
- ❌ Avoid: Long paragraphs, complex sentences
Tech Blog (技术博客)
Style: Professional but approachable, can be humorous
- ✅ Specific tech stack, tool names
- ✅ Code examples, performance data
- ✅ Real experiences ("踩过的坑", "实测效果")
- ✅ Clear structure with headings (not numbered lists)
- ❌ Avoid: 赋能, 闭环, 生态
- ❌ Avoid: 首先/其次/最后structure
Formal Article (正式文章)
Style: Objective, rigorous, but natural
- ✅ Clear logic with proper evidence
- ✅ Precise academic expressions
- ✅ Cited research sources
- ✅ Data and charts supporting arguments
- ❌ Avoid: Excessive rhetoric (对偶, 排比)
- ❌ Avoid: Empty grand words
Chat/Dialogue (对话场景)
Style: Friendly, patient, genuine
- ✅ Concise, targeted responses
- ✅ Empathy and understanding
- ✅ Direct solutions
- ✅ Moderate emoji use
- ❌ Avoid: 很高兴为您服务 (template phrases)
- ❌ Avoid: Lengthy explanations, repetitive questions
Customizing Patterns
Edit scripts/patterns_cn.json to add/modify:
ai_vocabulary_cn — Chinese AI high-frequency words
filler_phrases_cn — Clichés and replacements
empty_words_cn — Empty grand vocabulary
rhetoric_limits — Rhetoric frequency limits
scene_styles — Scene-specific style configs
Batch Processing
# Scan all files
for f in *.txt; do
echo "=== $f ==="
python scripts/detect_cn.py "$f" -s
done
# Transform all markdown (tech blog style)
for f in *.md; do
python scripts/humanize_cn.py "$f" --scene tech -o "${f%.md}_clean.md"
done
Reference
Based on comprehensive Chinese AI writing research:
- Tencent News: "Deconstructing 'AI Flavor': Why We Dislike AI Writing"
- 53AI: "Detection and Optimization of Article 'AI Flavor'"
- AIGCleaner and other Chinese de-AI tools
- Wikipedia: "Signs of AI Writing" (English reference)
Key insights:
- Perplexity: AI text has low perplexity (predictable word choices)
- Burstiness: AI text has low burstiness (uniform sentence structure)
- Emotion: AI text lacks strong opinions and personal color
1---2name: humanize-chinese3description: Detect and humanize AI-generated Chinese text with 6 style transforms (casual/zhihu/xiaohongshu/wechat/academic/literary). Removes "AI flavor" using 16 detection patterns. Pure Python, no dependencies. v1.1.04---5
6# Humanize Chinese AI Text
7
8Comprehensive CLI for detecting and transforming Chinese AI-generated text. Makes robotic AI writing natural and human-like with 6 specialized writing style transforms.
9
10**NEW in v1.1:** Style transforms (知乎/小红书/公众号/口语化/学术/文艺), enhanced detection (16 patterns), emotional analysis
11
12## Quick Start
13
14```bash
15# Detect AI patterns (16 categories)
16python scripts/detect_cn.py text.txt
17
18# Humanize text
19python scripts/humanize_cn.py text.txt -o clean.txt
20
21# Scene-specific humanization
22python scripts/humanize_cn.py text.txt --scene social # Social media
23python scripts/humanize_cn.py text.txt --scene tech # Tech blog
24python scripts/humanize_cn.py text.txt --scene formal # Formal article
25
26# NEW: Apply writing styles
27python scripts/humanize_cn.py text.txt --style zhihu -o zhihu.txt
28python scripts/humanize_cn.py text.txt --style xiaohongshu -o xhs.txt
29python scripts/style_cn.py text.txt --style casual -o casual.txt
30
31# List all available styles
32python scripts/style_cn.py --list
33
34# Compare before/after
35python scripts/compare_cn.py text.txt -o clean.txt
36```
37
38---
39
40## Detection Categories
41
42The analyzer checks for **16 pattern categories** specific to Chinese AI text (v1.1 added 4 new patterns):
43
44### Critical (Immediate AI Detection)
45| Category | Examples |
46|----------|----------|
47| Three-Part Structure | 首先...其次...最后, 一方面...另一方面 |
48| Mechanical Connectors | 值得注意的是, 综上所述, 不难发现 |
49| Empty Grand Words | 赋能, 闭环, 智慧时代, 数字化转型 |
50
51### High Signal
52| Category | Examples |
53|----------|----------|
54| AI High-Frequency Words | 助力, 彰显, 凸显, 焕发, 深度剖析 |
55| Technical Jargon Misuse | 解构, 量子纠缠, 光谱 (in non-tech context) |
56| Excessive Rhetoric | 对偶句 (>2x), 排比句 (>1x), 引用句 (>4x) |
57
58### Medium Signal
59| Category | Examples |
60|----------|----------|
61| Punctuation Overuse | Dense em dashes, excessive semicolons |
62| Obscure Metaphors | Forced, disconnected comparisons |
63| Uniform Paragraphs | Equal-length paragraphs (no rhythm) |
64
65### Style Signal
66| Category | Examples |
67|----------|----------|
68| Low Burstiness | Monotonous sentence structure |
69| Low Perplexity | Predictable word choices |
70| Emotional Flatness | **NEW** Lack of emotional words and expressions |
71| Repetitive Structure | **NEW** Sentence starters repeat >3 times |
72| Slang Overuse | **NEW** Internet slang in formal context |
73| Vocabulary Homogeneity | **NEW** Low diversity in word choice |
74
75---
76
77## Writing Style Transforms (NEW in v1.1)
78
79Transform text into 6 specialized Chinese writing styles:
80
81| Style | Name | Description | Best For |
82|-------|------|-------------|----------|
83| `casual` | 口语化风格 | Like chatting with friends — natural, relaxed | Social media, messaging |
84| `zhihu` | 知乎风格 | Rational, in-depth, with personal opinions | Q&A platforms, thoughtful analysis |
85| `xiaohongshu` | 小红书风格 | Enthusiastic, emoji-rich, product-focused | Lifestyle sharing, reviews, recommendations |
86| `wechat` | 公众号风格 | Storytelling, engaging, relatable | WeChat articles, newsletters |
87| `academic` | 学术风格 | Rigorous but not stiff, precise terminology | Academic papers, research reports |
88| `literary` | 文艺风格 | Poetic, imagery-rich, metaphorical | Creative writing, essays |
89
90### Usage
91
92```bash
93# Apply style directly
94python scripts/style_cn.py input.txt --style zhihu -o output.txt
95
96# Combine humanization + style
97python scripts/humanize_cn.py ai_text.txt --style xiaohongshu -o natural.txt
98
99# List all styles
100python scripts/style_cn.py --list
101```
102
103### Style Features
104
105#### Casual (口语化)
106- Removes formal structure (首先/其次/最后)
107- Adds colloquial connectors (说实话, 确实, 其实)
108- Includes tone particles (吧, 呢, 啊)
109- Light emoji usage
110
111#### Zhihu (知乎)
112- Personal opinion markers (从我的经验来看, 个人认为)
113- Data/evidence support (实测发现, 根据XX调研)
114- Example-driven (举个例子)
115- Logical but conversational
116
117#### Xiaohongshu (小红书)
118- Enthusiastic openers (姐妹们!分享一下~)
119- High emoji density (😊✨💯)
120- Intensifiers (超级, 巨, 绝绝子, yyds)
121- Hashtags (#好物分享)
122- Short paragraphs
123
124#### Wechat (公众号)
125- Story-driven openings
126- Questions for engagement (你有没有想过)
127- Relatable scenarios
128- Emotional connection
129
130#### Academic (学术)
131- Removes colloquialisms
132- Precise terminology
133- Formal connectors (研究表明, 数据显示)
134- Reduces emotional expressions
135
136#### Literary (文艺)
137- Metaphors and imagery
138- Poetic language
139- Descriptive phrases (在XX的光影里)
140- Artistic expressions
141
142---
143
144## Scripts
145
146### detect_cn.py — Scan Chinese AI Patterns
147
148```bash
149python scripts/detect_cn.py essay.txt
150python scripts/detect_cn.py essay.txt -j # JSON output
151python scripts/detect_cn.py essay.txt -s # score only
152echo "文本" | python scripts/detect_cn.py
153```
154
155**Output:**
156- AI feature statistics (by category)
157- AI probability score (low/medium/high/very high)
158- Auto-fixable patterns marked
159- Perplexity and burstiness indicators
160
161### humanize_cn.py — Transform to Human-Like
162
163```bash
164python scripts/humanize_cn.py essay.txt
165python scripts/humanize_cn.py essay.txt -o output.txt
166python scripts/humanize_cn.py essay.txt --scene social # Social media style
167python scripts/humanize_cn.py essay.txt -a # Aggressive mode
168```
169
170**Scene Parameters (--scene):**
171- `social`: Social media (casual, conversational)
172- `tech`: Tech blog (professional but approachable)
173- `formal`: Formal article (rigorous but natural)
174- `chat`: Chat/dialogue (friendly, concise)
175
176**Auto-fixes:**
177- Remove three-part structure (首先/其次/最后)
178- Replace mechanical connectors (值得注意的是 → 注意/要提醒的是)
179- Simplify empty words (赋能 → 帮助/提升, 闭环 → 完整流程)
180- Reduce punctuation density (em dash, semicolon)
181- Control rhetoric frequency (对偶, 排比, 比喻)
182
183**Aggressive Mode (-a):**
184- Add colloquial expressions
185- Inject emotional color
186- Vary sentence rhythm
187- Add personal perspective
188
189### compare_cn.py — Before/After Analysis
190
191```bash
192python scripts/compare_cn.py essay.txt
193python scripts/compare_cn.py essay.txt --scene tech -o clean.txt
194```
195
196Shows AI feature comparison and score changes before/after transformation.
197
198### style_cn.py — Writing Style Transform (NEW)
199
200```bash
201python scripts/style_cn.py essay.txt --style zhihu -o essay_zhihu.txt
202python scripts/style_cn.py blog.txt --style xiaohongshu -o blog_xhs.txt
203python scripts/style_cn.py --list # Show all available styles
204```
205
206**Supported styles:** casual, zhihu, xiaohongshu, wechat, academic, literary
207
208Transform text into specific Chinese writing styles with style-appropriate vocabulary, tone, and structure.
209
210---
211
212## Workflow
213
2141. **Scan** for detection risk:
215 ```bash
216 python scripts/detect_cn.py document.txt
217 ```
218
2192. **Transform** with comparison:
220 ```bash
221 python scripts/compare_cn.py document.txt --scene tech -o document_v2.txt
222 ```
223
2243. **Verify** improvement:
225 ```bash
226 python scripts/detect_cn.py document_v2.txt -s
227 ```
228
2294. **Manual review** for content quality and scene appropriateness
230
231---
232
233## AI Probability Scoring
234
235| Rating | Criteria |
236|--------|----------|
237| Very High | Three-part structure, mechanical connectors, or empty grand words present |
238| High | >20 issues OR issue density >3% |
239| Medium | >10 issues OR issue density >1.5% |
240| Low | <10 issues AND density <1.5% |
241
242---
243
244## Scene-Specific Guidelines
245
246### Social Media (社交媒体)
247**Style:** Casual, conversational, like chatting with friends
248- ✅ Short paragraphs (1-3 sentences)
249- ✅ Colloquial expressions (说实话, 没想到, 真的绝了)
250- ✅ Specific details (product names, locations, personal feelings)
251- ✅ Emoji and hashtags
252- ❌ Avoid: 值得注意的是, 总而言之
253- ❌ Avoid: Long paragraphs, complex sentences
254
255### Tech Blog (技术博客)
256**Style:** Professional but approachable, can be humorous
257- ✅ Specific tech stack, tool names
258- ✅ Code examples, performance data
259- ✅ Real experiences ("踩过的坑", "实测效果")
260- ✅ Clear structure with headings (not numbered lists)
261- ❌ Avoid: 赋能, 闭环, 生态
262- ❌ Avoid: 首先/其次/最后structure
263
264### Formal Article (正式文章)
265**Style:** Objective, rigorous, but natural
266- ✅ Clear logic with proper evidence
267- ✅ Precise academic expressions
268- ✅ Cited research sources
269- ✅ Data and charts supporting arguments
270- ❌ Avoid: Excessive rhetoric (对偶, 排比)
271- ❌ Avoid: Empty grand words
272
273### Chat/Dialogue (对话场景)
274**Style:** Friendly, patient, genuine
275- ✅ Concise, targeted responses
276- ✅ Empathy and understanding
277- ✅ Direct solutions
278- ✅ Moderate emoji use
279- ❌ Avoid: 很高兴为您服务 (template phrases)
280- ❌ Avoid: Lengthy explanations, repetitive questions
281
282---
283
284## Customizing Patterns
285
286Edit `scripts/patterns_cn.json` to add/modify:
287- `ai_vocabulary_cn` — Chinese AI high-frequency words
288- `filler_phrases_cn` — Clichés and replacements
289- `empty_words_cn` — Empty grand vocabulary
290- `rhetoric_limits` — Rhetoric frequency limits
291- `scene_styles` — Scene-specific style configs
292
293---
294
295## Batch Processing
296
297```bash
298# Scan all files
299for f in *.txt; do
300 echo "=== $f ==="
301 python scripts/detect_cn.py "$f" -s
302done
303
304# Transform all markdown (tech blog style)
305for f in *.md; do
306 python scripts/humanize_cn.py "$f" --scene tech -o "${f%.md}_clean.md"
307done
308```
309
310---
311
312## Reference
313
314Based on comprehensive Chinese AI writing research:
315- Tencent News: "Deconstructing 'AI Flavor': Why We Dislike AI Writing"
316- 53AI: "Detection and Optimization of Article 'AI Flavor'"
317- AIGCleaner and other Chinese de-AI tools
318- Wikipedia: "Signs of AI Writing" (English reference)
319
320Key insights:
321- **Perplexity**: AI text has low perplexity (predictable word choices)
322- **Burstiness**: AI text has low burstiness (uniform sentence structure)
323- **Emotion**: AI text lacks strong opinions and personal color