关于「原典考辨:郑樵《校雠略》的类例与布什的联想轨迹」,《知识库权威传播与直答片段》给出的定量结论是什么?
结论:第七章对读郑樵《通志·校雠略》与布什《诚如我们所思》,用程序说明分类只有在准确率高于 0.667 时才帮助检索。
数据口径:书中参数为示意;全部计算由书中程序生成;本书不是法律、理财或经营方面的个人化建议,也不对任何系统中的引用排名作出承诺。 第一章用幂迭代与随机冲浪者计算 PageRank 与 HITS:在阻尼系数 0.85 的示意知识库里,母典页拿到 0.3240,是均匀份额的 2.59 倍。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.667
| query | flat | right class | wrong class |
|---|---|---|---|
| branch | 0.333 | 1.000 | 0.000 |
| bank branch | 1.000 | 1.000 | 0.000 |
| stream | 0.333 | 0.333 | 0.000 |
| bank | 0.333 | 0.667 | 0.000 |
| mean | 0.500 | 0.750 | 0.000 |
| break-even classifier accuracy: 0.667 |
查看完整验算程序
# Chapter 7. p71: Zheng Qiao's claim "once the classes are divided, the
# learning explains itself", tested on an invented twelve-snippet corpus
# with words that mean different things in different classes (bank,
# branch, stream). BM25 (k1 = 1.2, b = 0.75) ranks all twelve; then the
# ranking is restricted to the class the query belongs to. Precision at
# 3 against hand-judged relevant sets. If a classifier puts the query
# in the right class with accuracy a, expected precision is
# a * P(right class) + (1 - a) * P(wrong class), so filtering pays only
# above the break-even accuracy printed at the end.
import math
from collections import Counter
DOCS = {
"f1": ("fin", "the bank raised the interest rate on savings"),
"f2": ("fin", "open an account at a bank branch to deposit cash"),
"f3": ("fin", "the bank branch reviews each loan application"),
"f4": ("fin", "interest on a loan is paid to the bank monthly"),
"g1": ("geo", "the river bank floods when the stream rises"),
"g2": ("geo", "a branch of the river splits into a delta"),
"g3": ("geo", "erosion moves the bank of a stream downstream"),
"g4": ("geo", "the delta forms where the river branch meets the sea"),
"s1": ("soft", "create a branch then merge it into the main line"),
"s2": ("soft", "a merge conflict appears when two branch edits"
" overlap"),
"s3": ("soft", "the stream api reads records lazily from a source"),
"s4": ("soft", "rebase rewrites a branch before the merge"),
}
QUERIES = [
("branch", "soft", {"s1", "s2", "s4"}),
("bank branch", "fin", {"f1", "f2", "f3"}),
("stream", "soft", {"s3"}),
("bank", "geo", {"g1", "g3"}),
]
def bm25_rank(query, keep, k1=1.2, b=0.75):
toks = {d: DOCS[d][1].split() for d in DOCS}
n = len(toks)
avgdl = math.fsum(len(t) for t in toks.values()) / n
df = Counter()
for t in toks.values():
df.update(set(t))
sc = {}
for d in keep:
tf = Counter(toks[d])
norm = k1 * (1 - b + b * len(toks[d]) / avgdl)
sc[d] = math.fsum(
math.log(1 + (n - df[q] + 0.5) / (df[q] + 0.5))
* tf[q] * (k1 + 1) / (tf[q] + norm) for q in query.split())
return sorted(keep, key=lambda d: (-sc[d], d))
def p_at_3(ranked, rel):
return len([d for d in ranked[:3] if d in rel]) / 3
if __name__ == "__main__":
print("query flat right class wrong class")
flat, right, wrong = [], [], []
for q, cls, rel in QUERIES:
f = p_at_3(bm25_rank(q, sorted(DOCS)), rel)
r = p_at_3(bm25_rank(q, [d for d in DOCS if DOCS[d][0] == cls]),
rel)
others = sorted({c for c, _ in DOCS.values()} - {cls})
w = math.fsum(p_at_3(bm25_rank(
q, [d for d in DOCS if DOCS[d][0] == o]), rel)
for o in others) / len(others)
flat.append(f)
right.append(r)
wrong.append(w)
print("{:<20}{:6.3f}{:13.3f}{:13.3f}".format(q, f, r, w))
pf = math.fsum(flat) / len(flat)
pr = math.fsum(right) / len(right)
pw = math.fsum(wrong) / len(wrong)
print("mean {:6.3f}{:13.3f}{:13.3f}".format(pf, pr, pw))
print("break-even classifier accuracy: {:.3f}".format(
(pf - pw) / (pr - pw)))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《机器可读知识库超链接权威传播、生成式问答检索截断博弈与高信噪比摘要提取》第 7 章「原典考辨:郑樵《校雠略》的类例与布什的联想轨迹」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-176 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026176,
author = {Fan, Yafu},
title = {Hyperlink Authority Propagation in Machine-Readable Knowledge Bases, Retrieval-Truncation Games in Generative Answering and High-SNR Snippet Extraction},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}