关于「风格防退化:句长、词汇多样性、套话与段首的门槛」,《多窗口写书防漂移》给出的定量结论是什么?
结论:两段的篇幅相近,A 有 271 个汉字,B 有 233 个,可是几乎每一项都分开了。句长的变异系数,A 是 0.670,B 只有 0.371;落在中位数上下三个字以内的句子,A 占 0.267,B 占 0.455。A 的句子有长有短,「改一个数只要十秒」只有八个字,紧挨着一句四十字的解释;B 的句子几乎全挤在二十字上下。类符形符比 A 是 0.590,B 是 0.322;按 MTLD 算,A 是 128.1,B 掉到 44.5。套话命中,A 每千字为零,B 每千字 128.8 次。六个段落里,B 有四段共用同一个四字开头;字符八元组里重复出现的比例,A 为 0.000,B 为 0.199。
数据口径:书中未标出处的错误率都是假设参数或合成数据上的测量值;本书不是法律意见,也不推荐任何写作工具或模型。 第八章让四个窗口并发写一本九章合成书,注入五类共 119 个错误:四道闸门拦住 0.723,漏网的 33 个里有 28 个属于机器在结构上看不见的手法,扣除后检出率为 0.945;干净书上术语检测首轮误报 1672 处,人审 48 个词后归零;一份严肃的注入审计每类至少要 75 个错误。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.000, 0.199, 0.267, 0.322, 0.371, 0.455
| metric | text A | text B |
|---|---|---|
| CJK characters | 271 | 233 |
| paragraphs | 6 | 6 |
| sentences | 15 | 11 |
| sentence length mean | 18.07 | 21.18 |
| sentence length sd | 12.11 | 7.86 |
| coefficient of variation | 0.670 | 0.371 |
| share within 3 of median | 0.267 | 0.455 |
| type-token ratio | 0.590 | 0.322 |
| MTLD (threshold 0.72) | 128.1 | 44.5 |
| template hits per 1000 | 0.0 | 128.8 |
| paragraphs w/ shared opener | 0 | 4 |
| most common opener count | 1 | 4 |
| 8-gram repeat share | 0.000 | 0.199 |
查看完整验算程序
# Chapter 6. p60: Style profile of two fictional passages on the same topic, one healthy, one degraded.
# Tokens are CJK characters (punctuation and digits dropped). Sentences end at a full stop, "!" or "?".
# Metrics: sentence-length mean / sd / coefficient of variation, share of sentences within 3 chars
# of the median, type-token ratio, MTLD (factor threshold 0.72, mean of forward and backward runs,
# McCarthy & Jarvis 2010), template phrases per 1000 characters, paragraph openers shared with
# another paragraph (first 4 characters), and the share of character 8-grams that occur twice or more.
import math
import re
import statistics
from collections import Counter
TEXT_A = """周三夜里,第三卷的校样回到了工作室。林蔚先翻数字:第二章说锁的租约是九十秒,第五章写成了两分钟。\
错不在谁偷懒,是两个窗口各自记住了不同的草稿。
她没有直接改。先查程序输出,九十秒是对的;再查第五章的上下文,原来那段讲的是心跳间隔,作者把两个参数挤进了同一句。
改一个数只要十秒。查清它为什么错,花了四十分钟。
第二件事是引文。某篇论文的年份在第一卷写作一九九七,在第三卷写作一九九八,标题却一字不差。\
台账里存着原刊目录页的扫描件,一九九七对。
凌晨一点,她把两处改动记进勘误表,每条写明出处页码、改前、改后、依据。明天合伙人复核,签字后才算数。
校书慢吗?慢。可是一个错数字印进三千本书,再追回来,比今晚多坐一小时贵得多。"""
TEXT_B = """值得注意的是,在多窗口写作的过程中,数字的一致性是至关重要的。我们需要认真核对每一个数字。
值得注意的是,在校对的过程中,我们需要认真核对每一个参数。总的来说,参数的一致性是不可或缺的。
总的来说,在引文核对的过程中,我们需要认真核对每一个出处。出处的准确性是至关重要的。
值得注意的是,在勘误的过程中,我们需要认真记录每一处改动。记录的完整性是不可或缺的。
值得注意的是,在复核的过程中,合伙人的签字是不可或缺的。我们需要认真对待每一次复核。
综上所述,校对工作是至关重要的,我们需要认真对待每一个细节,不断提升校对的质量。"""
TEMPLATES = ["值得注意的是", "总的来说", "综上所述", "至关重要", "不可或缺", "众所周知", "不难发现",
"毋庸置疑", "在当今", "的过程中", "我们需要", "不断提升", "认真对待", "认真核对"]
FACTOR = 0.72
def cjk(s):
return re.findall(r"[一-鿿]", s)
def sentences(text):
return [s for s in re.split(r"[。!?]", text) if cjk(s)]
def mtld_one(tokens):
factors, types, n = 0.0, set(), 0
for t in tokens:
types.add(t)
n += 1
if len(types) / n <= FACTOR:
factors += 1
types, n = set(), 0
if n:
factors += (1 - len(types) / n) / (1 - FACTOR)
return len(tokens) / factors if factors else float("inf")
def mtld(tokens):
return (mtld_one(tokens) + mtld_one(tokens[::-1])) / 2
def profile(text):
paras = [p for p in text.split("\n") if p.strip()]
lens = [len(cjk(s)) for s in sentences(text)]
toks = cjk(text)
med = statistics.median(lens)
mean = math.fsum(lens) / len(lens)
sd = statistics.pstdev(lens)
heads = Counter("".join(cjk(p))[:4] for p in paras)
shared = sum(c for c in heads.values() if c > 1)
hits = sum(text.count(t) for t in TEMPLATES)
grams = Counter("".join(toks)[i:i + 8] for i in range(len(toks) - 7))
rep = sum(c for c in grams.values() if c > 1) / max(1, sum(grams.values()))
return {"chars": len(toks), "paragraphs": len(paras), "sentences": len(lens), "mean": mean,
"sd": sd, "cv": sd / mean, "near_median": sum(abs(x - med) <= 3 for x in lens) / len(lens),
"ttr": len(set(toks)) / len(toks), "mtld": mtld(toks), "tpl_per_1000": 1000 * hits / len(toks),
"shared_openers": shared, "top_opener": heads.most_common(1)[0][1], "rep8": rep}
if __name__ == "__main__":
a, b = profile(TEXT_A), profile(TEXT_B)
print(" metric text A text B")
rows = [("CJK characters", "chars", "{:d}"), ("paragraphs", "paragraphs", "{:d}"),
("sentences", "sentences", "{:d}"), ("sentence length mean", "mean", "{:.2f}"),
("sentence length sd", "sd", "{:.2f}"), ("coefficient of variation", "cv", "{:.3f}"),
("share within 3 of median", "near_median", "{:.3f}"), ("type-token ratio", "ttr", "{:.3f}"),
("MTLD (threshold 0.72)", "mtld", "{:.1f}"), ("template hits per 1000", "tpl_per_1000", "{:.1f}"),
("paragraphs w/ shared opener", "shared_openers", "{:d}"),
("most common opener count", "top_opener", "{:d}"), ("8-gram repeat share", "rep8", "{:.3f}")]
for label, key, fmt in rows:
print(" {:<27s} {:>8s} {:>8s}".format(label, fmt.format(a[key]), fmt.format(b[key])))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《多窗口并行写书防漂移控制、术语跨卷一致性图审计与零幻觉文献核验器》第 6 章「风格防退化:句长、词汇多样性、套话与段首的门槛」(版本 0.1.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-152 · v0.1.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026152,
author = {Fan, Yafu},
title = {Drift Control for Parallel Multi-Window Book Writing, Cross-Volume Terminology Graph Audits and Zero-Hallucination Citation Verifiers},
year = {2026},
publisher = {5D Library},
edition = {0.1.0},
note = {DOI pending}
}