docs(architecture): 完成技术验证 S1–S4,确定 FR-M2-05/06 目标值
- spikes/:Word 转 PDF(Gotenberg)、格式识别、原句坐标、DeepSeek 抽取四项验证代码与两版提示词;样本派生产物和 .env 不进 git - tech-validation.md:完整结论。四项都可行:WPS 字体字符集要修正并改用行高调整过的字体;格式识别不需要 Docling;表格内切句待改进;抽取需第三道依据校验与规则兜底 - architecture.md:§3.5 加预处理与字体包,§3.6 证据校验改为三道,§10 回填结论 - 03 功能需求与 decisions.md(TV1):召回 ≥ 99%、采纳准确率 ≥ 95%、页码 100%、高亮正文 ≥ 98% / 表格 ≥ 95% Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
17
spikes/s1-convert/fonts_used.py
Normal file
17
spikes/s1-convert/fonts_used.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""统计样本用到的字体(东亚字体),决定字体替换表要覆盖哪些。"""
|
||||
import collections, re, sys, zipfile, pathlib
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent.parent))
|
||||
from common import IDS, sample_file, sniff
|
||||
tot = collections.Counter()
|
||||
for sid in IDS:
|
||||
f = sample_file(sid)
|
||||
if sniff(f) != "docx":
|
||||
continue
|
||||
with zipfile.ZipFile(f) as z:
|
||||
xml = z.read("word/document.xml").decode("utf-8", "replace")
|
||||
sty = z.read("word/styles.xml").decode("utf-8", "replace") if "word/styles.xml" in z.namelist() else ""
|
||||
c = collections.Counter(re.findall(r'w:eastAsia="([^"]+)"', xml + sty))
|
||||
c.update(re.findall(r'w:ascii="([^"]+)"', xml + sty))
|
||||
tot.update(c)
|
||||
print(sid, c.most_common(6))
|
||||
print("TOTAL", tot.most_common(15))
|
||||
Reference in New Issue
Block a user