关于「候选改写的约束优化:事实凭据、复扫与标题长度」,《极限词合规改写》给出的定量结论是什么?

结论:改写不是删词,而是在三条约束下选候选:事实要有出处,整行复扫不能有新命中,标题要放得下。程序 p41 在一行标题上依次排除了没有凭据的「国标一等品」与复扫命中的「业内最佳」,得到零命中的改写,长度从 16 个字变成 21 个字。程序 p42 把长度约束写成多选背包,最优选择随上限跳动:上限 14 时留材质、删价格,上限 12 时反过来;打平的解应交给人工。这里的保真分数一直被当作已知输入。下一章要问:分数从哪里来,常用的文本相似度能不能直接拿来当分数?

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

English version

对照数据表

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

greedy per-hit choice: length 21, fidelity 2.40
Llengthfidelitypicks (material | price | gift)
21212.40tou | dao | pei
18162.10tou | dao | -
16162.10tou | dao | -
14141.60tou | - | shi
12121.60- | dao | -
10101.10- | - | shi
770.90- | - | -
6no admissible title fits
查看完整验算程序
# Chapter 4. p42: choosing rewrites jointly under a title-length budget.
# Model: a multiple-choice knapsack. Each hit must take exactly one of
# its admissible candidates (from p41, deletion included); maximise
# total fidelity subject to total length <= L syllables (one syllable =
# one Chinese character). Solved twice, by enumeration and by dynamic
# programming over (hit, length), and the two answers must agree.
# The 7 syllables outside the hits stay as they are.
import itertools
import math

FIXED = 7
OPTS = [[("tou ceng niu pi", 0.80), ("", 0.30)],
        [("dao shou jia 1299 yuan", 0.90),
         ("ben dian jin qi you hui", 0.55), ("", 0.20)],
        [("pei li pin he de", 0.70), ("shi he zuo", 0.60), ("", 0.40)]]


def size(text):
    return len(text.split())


def enum_best(cap):
    best = None
    for combo in itertools.product(*OPTS):
        ln = FIXED + math.fsum(size(t) for t, _ in combo)
        fid = math.fsum(f for _, f in combo)
        if ln <= cap and (best is None or fid > best[0] + 1e-12):
            best = (fid, int(ln), combo)
    return best


def dp_best(cap):
    room = cap - FIXED
    table = {0: (0.0, ())}          # length used -> (fidelity, picks)
    for opts in OPTS:
        nxt = {}
        for used, (fid, picks) in sorted(table.items()):
            for k, (t, f) in enumerate(opts):
                u = used + size(t)
                if u > room:
                    continue
                cand = (fid + f, picks + (k,))  # step: one item per hit
                if u not in nxt or cand[0] > nxt[u][0] + 1e-12:
                    nxt[u] = cand
        table = nxt
    if not table:
        return None
    u, (fid, picks) = max(table.items(), key=lambda kv: (kv[1][0], -kv[0]))
    return fid, u + FIXED, picks


greedy = [opts[0] for opts in OPTS]
print("greedy per-hit choice: length %d, fidelity %.2f"
      % (FIXED + int(math.fsum(size(t) for t, _ in greedy)),
         math.fsum(f for _, f in greedy)))
print("  L  length  fidelity  picks (material | price | gift)")
for cap in [21, 18, 16, 14, 12, 10, 7, 6]:
    e = enum_best(cap)
    d = dp_best(cap)
    if e is None:
        assert d is None
        print("%3d  no admissible title fits" % cap)
        continue
    assert abs(e[0] - d[0]) < 1e-9
    names = [t.split()[0] if t else "-" for t, _ in e[2]]
    print("%3d  %5d   %7.2f   %s" % (cap, e[1], e[0], " | ".join(names)))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《平台敏感词合规改写、广告法极限词自动机与语义保真转化弹性母典》第 4 章「候选改写的约束优化:事实凭据、复扫与标题长度」(版本 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}
}

本书其他章节结论