🤖 RAG Retrieval Recall Calculator
Compute retrieval recall from the number of relevant documents and the number actually retrieved, to measure the coverage of your RAG retriever.
📐 计算公式 / 原理
召回率 = 检索到的相关文档数 / 相关文档总数 × 100%;精确率 = 检索到的相关文档数 / 检索总数 × 100%;F1 = 2·命中数/(相关总数 + 检索返回数);命中率 = 检索到 ≥1 篇相关 ? 100% : 0。命中数为 0 且两分母有效时 F1=0,不是无定义。
RAG 的检索质量直接决定生成上限:召回率不足会漏掉关键证据导致幻觉,精确率不足则把噪声塞进上下文稀释注意力。命中率(Recall@k 的特例)常用于快速判断 top-k 是否够用。
📐 计算公式与说明
Recall = 检索到的相关 / 所有相关
Precision = 检索到的相关 / 检索总数
Precision = 检索到的相关 / 检索总数
RAG 系统需权衡召回率与精确率。