练习包 · Builder:用 10 篇站内文档搭一个带引用的问答Exercise: cited answers from 10 source pages
一个可独立完成的 RAG 练习:选 10 篇站内页面做语料,产出 10 题答案、引用表、评测表与失败记录;附评分标准与参考答案结构。
A self-contained RAG exercise: use 10 site pages as a corpus and produce 10 answers, a citation table, an evaluation sheet and a failure log, with a rubric and a model-answer outline.
任务The task
用 10 篇站内页面做唯一语料,搭一个能回答问题的问答流程。不允许接外部搜索,不允许凭记忆补充。题数和评分线是本练习的教学约束,不是生产系统的通用标准。
- 从 learn 站任选 10 个词条页,主题集中在一个领域(如 RAG 或本地部署)。
- 把它们切成可检索的片段,记录切分规则(按段、按标题、固定长度)。
- 写 10 个问题,其中 3 个的答案不在语料里,用来测拒答。
- 每次回答必须带引用:页面标题 + 链接 + 命中的原文句子。
- 记录每次失败:答错、答偏、编造、引用错页。
Use ten site pages as the only corpus for a question-answering workflow. Do not add external search or fill gaps from memory. The question count and passing score are teaching constraints for this exercise, not universal production standards.
- Choose ten Learn term pages concentrated in one area, such as RAG or local deployment.
- Split them into retrievable passages and record whether you split by paragraph, heading or fixed length.
- Write ten questions; three should have no answer in the corpus, to test abstention.
- Every answer must cite a page title, link and supporting source sentence.
- Record failures: incorrect answers, off-topic answers, fabrication or citations to the wrong page.
交付物Deliverables
| 文件 | 内容 | 检查点 |
|---|---|---|
answers.md | 10 题答案,逐题带引用 | 每条引用能点回原文并找到该句 |
citations.csv | 题目 / 引用页 / 原文句 / 是否命中 | 10 行,无空行 |
eval.csv | 题目 / 判定(对/错/拒答)/ 原因 | 判定可被第二人复核 |
failures.md | 失败记录与改法 | 按实际情况记录并写清触发条件;人为构造的失败输入须标注 |
| File | Contents | Check |
|---|---|---|
answers.md | Ten answers, each with citations | Every citation links back to a source where the sentence can be located |
citations.csv | Question / cited page / source sentence / supported? | Ten rows, no blank rows |
eval.csv | Question / verdict (correct, incorrect, abstained) / reason | Another reader can review the verdict |
failures.md | Failures and proposed fixes | Record actual outcomes and triggers; label deliberately constructed failure inputs |
评分标准Rubric
每项 0–2 分,共 10 分:
| 维度 | 0 分 | 1 分 | 2 分 |
|---|---|---|---|
| 引用准确 | 引用页与答案无关 | 引用页相关但句子对不上 | 每条都能点回并找到原句 |
| 拒答 | 不会的题也硬答 | 拒答了但没说缺什么 | 3 道无答案题全部拒答并说明缺口 |
| 评测可复核 | 只有「感觉对」 | 有判定但无原因 | 每题有判定与可复核原因 |
| 失败记录 | 没记录 | 记了现象 | 记了触发条件与改法 |
| 可复现 | 别人跑不出同样结果 | 步骤缺一环 | 切分、检索、提示词三步可照做 |
8 分及格;6 分以下回到「怎么评测 RAG 的效果」重做。
Award 0–2 for each item, for a total of ten:
| Dimension | 0 | 1 | 2 |
|---|---|---|---|
| Citation accuracy | Page unrelated to answer | Relevant page, but sentence does not support answer | Every source sentence can be located and supports the answer |
| Abstention | Answers unsupported questions anyway | Abstains without explaining the gap | Abstains on all three unanswerable questions and explains what is missing |
| Reviewable evaluation | Only “feels right” | Verdict without a reason | Verdict and reviewable reason for every question |
| Failure log | No log | Symptoms only | Trigger conditions and proposed fixes |
| Reproducibility | Others cannot follow the process | A step is missing | Chunking, retrieval and prompting steps can be followed |
Eight is the exercise's passing score. Below six, return to the RAG evaluation guide and repeat the exercise.
参考答案结构Model answer outline
不提供逐题答案(语料由你选),提供合格答案的结构:
问题:分块时为什么要保留标题和页码?
答案:它们可作为元数据,让检索时按结构信息过滤。
引用:《怎么给文档做分块》「怎么做」第 6 项;原文句:「保留结构信息:标题、章节、页码存进元数据,检索时能过滤。」
判定:对;原因:引用句直接支持答案。
拒答题的合格写法:
问题:这个模型在 2026-11-01 的准确率是多少?
答案:语料里没有该日期的评测数据,无法回答。需要补充官方评测页或自建评测。
判定:拒答;原因:语料中无对应事实。The corpus is your choice, so this supplies an answer structure rather than answers to every question:
Question: Why preserve headings and page numbers when chunking?
Answer: They can be stored as metadata to filter retrieval by document structure.
Citation: How to Chunk Documents for Retrieval, “How to do it”, item 6.
Source sentence (Chinese original): 保留结构信息:标题、章节、页码存进元数据,检索时能过滤。
Verdict: correct; the cited sentence directly supports the answer.
An acceptable abstention:
Question: What was this model's accuracy on 2026-11-01?
Answer: The corpus contains no evaluation data for that date, so this cannot be answered.
An official evaluation page or a suitable evaluation would be needed.
Verdict: abstained; the required fact is absent from the corpus.
常见失分Common misses
- 引用整页而不是句子:读者无法核对。
- 把「语义相近」当「原文支持」:答案超出引用句。
- 无答案题也答:宁可拒答,不要补记忆。
- 只测正常输入会漏掉边界问题;补充无答案、缺字段和不符合格式的样本。
- Citing a whole page instead of a supporting sentence makes checking difficult.
- Semantic similarity does not establish support; an answer may go beyond the cited text.
- Abstain on unanswerable questions rather than filling gaps from memory.
- Normal inputs alone miss boundary cases. Add unanswerable questions, missing fields and malformed inputs.
出处Sources
| 来源Source | 链接URL |
|---|---|
| 本站 · RAG 全链路:从文档到答案This site: RAG end to end, from documents to answers | https://learn.specul.com/guide/RAG%20全链路:从文档到答案/https://learn.specul.com/guide/RAG%20%E5%85%A8%E9%93%BE%E8%B7%AF%EF%BC%9A%E4%BB%8E%E6%96%87%E6%A1%A3%E5%88%B0%E7%AD%94%E6%A1%88/ |
| 本站 · 怎么给文档做分块This site: how to chunk documents for retrieval | https://learn.specul.com/guide/怎么给文档做分块/https://learn.specul.com/guide/%E6%80%8E%E4%B9%88%E7%BB%99%E6%96%87%E6%A1%A3%E5%81%9A%E5%88%86%E5%9D%97/ |
| 本站 · 怎么评测 RAG 的效果This site: how to evaluate RAG | https://learn.specul.com/guide/怎么评测%20RAG%20的效果/https://learn.specul.com/guide/%E6%80%8E%E4%B9%88%E8%AF%84%E6%B5%8B%20RAG%20%E7%9A%84%E6%95%88%E6%9E%9C/ |
| 本站 · 怎么验证 AI 的输出This site: how to verify AI output | https://learn.specul.com/guide/怎么验证%20AI%20的输出/https://learn.specul.com/guide/%E6%80%8E%E4%B9%88%E9%AA%8C%E8%AF%81%20AI%20%E7%9A%84%E8%BE%93%E5%87%BA/ |
资料快照日期:2026-11-03;单项复核范围与日期见对应正文或来源记录。产品功能与条款可能变化,使用前请核对原始来源。Source snapshot: 2026-11-03; item-specific rechecks and their scope are recorded in the text or source notes. Features and terms may change; check the original sources before use.