关于「误杀与漏检:豁免语境、审计补词与审计样本量」,《极限词合规改写》给出的定量结论是什么?

结论:第三章量化误杀与漏检:审计补词后,新一周的漏检率从 0.310 降到 0.076,误杀率 0.074;要让漏检率的 95 % 上界低于 0.01,零漏检也要审计 299 行违规文案。

数据口径:在示意参数下,一个极限词要抵消每月 0.010 的出事概率乘以出事成本,需要 0.0333 的相对转化增益;已发表的研究提示吹嘘的作用在不同顾客那里正负相抵,混合模型中增益超过盈亏平衡值的情形只占 0.042。 书中的词表、文案、事实与参数均为示意;全部计算由书中程序生成;本书是非个人化法律建议,也不提供任何绕开平台审核的手法。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.074, 0.076, 0.310, 95

week detTPFPFNTNfalse-killmissprecision
AD095 130241510.4630.2020.422
AD19523242580.0820.2020.805
AD2119002810.0000.0001.000
BD0109 129491130.5330.3100.458
BD110933492090.1360.3100.768
BD214618122240.0740.0760.890
查看完整验算程序
# Chapter 3. p31: false kills and misses of three lexicon versions.
# Model: two synthetic weekly samples of listing lines, built from
# labelled templates (fixed seeds). Label V = the line makes an
# absolute or unverified claim about the product; C = it does not.
# Week B adds one new absolute phrasing and one new exempt context
# that the audit of week A never saw. Detector D0 = bare lexicon;
# D1 = D0 + exempt contexts; D2 = D1 + the additions found by
# auditing week A. False-kill rate = FP / (FP + TN); miss rate =
# FN / (FN + TP). Templates, weights and sizes are illustrative.
import random
from collections import deque

BASE = [("zui jia", "ABS"), ("di yi", "ABS"), ("ding ji", "ABS"),
        ("quan wang zui di", "ABS"), ("guo jia ji", "ABS"),
        ("wei yi", "ABS"), ("ling cha ping", "UNV"),
        ("zui jia shang wei qi", "OK"), ("di yi ci", "OK"),
        ("di yi bu", "OK"), ("wei yi ma", "OK")]
AUDIT = [("wu ren neng bi", "ABS"), ("shi shang zui", "ABS"),
         ("zui jia shi yong", "OK")]
DET = {"D0": [e for e in BASE if e[1] != "OK"], "D1": BASE,
       "D2": BASE + AUDIT}
PROD = ["zhen pi bao", "lv cha", "mian ma chen shan", "tao ci bei"]
# (label, template, weight in week A, weight in week B)
TPL = [("V", "{p} quan wang zui di jia", 3, 3),
       ("V", "{p} zui jia xuan ze", 3, 3),
       ("V", "ding ji {p}", 3, 3),
       ("V", "guo jia ji gong yi {p}", 2, 2),
       ("V", "{p} pin lei di yi", 3, 3),
       ("V", "{p} ling cha ping", 2, 2),
       ("V", "{p} wu ren neng bi", 2, 2),
       ("V", "{p} shi shang zui hao", 2, 2),
       ("V", "{p} wu yu lun bi", 0, 2),
       ("C", "{p} zui jia shang wei qi liu ge yue", 4, 4),
       ("C", "di yi ci gou mai {p} mian yun fei", 4, 4),
       ("C", "di yi bu qing xi {p}", 3, 3),
       ("C", "{p} wei yi ma ke cha", 3, 3),
       ("C", "{p} zui jia shi yong wen du", 3, 3),
       ("C", "{p} di yi pi dao huo", 0, 3),
       ("C", "{p} jin san shi tian xiao shou", 10, 10),
       ("C", "{p} ben pin pai xin kuan", 10, 10)]


def build(lex):
    goto, fail, out = [{}], [0], [[]]
    for pid, (w, _) in enumerate(lex):
        s = 0
        for tok in w.split():
            if tok not in goto[s]:
                goto.append({})
                fail.append(0)
                out.append([])
                goto[s][tok] = len(goto) - 1
            s = goto[s][tok]
        out[s].append(pid)
    queue = deque(goto[0].values())
    while queue:
        r = queue.popleft()
        for tok, s in goto[r].items():
            queue.append(s)
            f = fail[r]
            while f and tok not in goto[f]:
                f = fail[f]
            fail[s] = goto[f].get(tok, 0)
            out[s] = out[s] + out[fail[s]]
    return goto, fail, out


def flagged(toks, lex, ac):
    goto, fail, out = ac
    s, spans = 0, []
    for i, tok in enumerate(toks):
        while s and tok not in goto[s]:
            s = fail[s]
        s = goto[s].get(tok, 0)
        for pid in out[s]:
            n = len(lex[pid][0].split())
            spans.append((i + 1 - n, i + 1, lex[pid][1]))
    ok = [(a, b) for a, b, c in spans if c == "OK"]
    for a, b, c in spans:
        if c != "OK" and not any(x <= a and b <= y for x, y in ok):
            return True
    return False


def sample(col, n):
    rng = random.Random(20261113 if col == 2 else 20261120)
    w = [t[col] for t in TPL]
    lines = []
    for _ in range(n):
        lab, tpl = rng.choices(TPL, weights=w)[0][:2]
        lines.append((lab, tpl.format(p=rng.choice(PROD)).split()))
    return lines


WEEKS = {"A": sample(2, 400), "B": sample(3, 400)}
print("week det   TP  FP  FN   TN  false-kill  miss   precision")
for wk, lines in WEEKS.items():
    for name, lex in DET.items():
        ac = build(lex)
        tp = fp = fn = tn = 0
        for lab, toks in lines:
            f = flagged(toks, lex, ac)
            if lab == "V" and f:
                tp += 1
            elif lab == "V":
                fn += 1
            elif f:
                fp += 1
            else:
                tn += 1
        print("  %s  %s  %4d %3d %3d %4d      %.3f  %.3f      %.3f"
              % (wk, name, tp, fp, fn, tn, fp / (fp + tn),
                 fn / (fn + tp), tp / (tp + fp)))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《平台敏感词合规改写、广告法极限词自动机与语义保真转化弹性母典》第 3 章「误杀与漏检:豁免语境、审计补词与审计样本量」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-274 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026274,
  author    = {Fan, Yafu},
  title     = {Compliant Rewriting for Platform-Sensitive Terms: Absolute-Term Automata under the Advertising Law, Meaning-Preserving Rewrites and Conversion Elasticity},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论