{"id":121481,"date":"2026-11-02T22:16:36","date_gmt":"2026-11-02T14:16:36","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/121481.html"},"modified":"2026-11-02T22:16:36","modified_gmt":"2026-11-02T14:16:36","slug":"rag%e5%88%ab%e5%8f%aa%e4%be%9d%e8%b5%96%e5%90%91%e9%87%8f%e5%8f%ac%e5%9b%9e%ef%bc%81bm25%e6%a3%80%e7%b4%a2%e5%bf%ab%e9%80%9f%e4%b8%8a%e6%89%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/121481.html","title":{"rendered":"RAG\u522b\u53ea\u4f9d\u8d56\u5411\u91cf\u53ec\u56de\uff01BM25\u68c0\u7d22\u5feb\u901f\u4e0a\u624b"},"content":{"rendered":"<p>\u5f88\u591aRAG\u5f00\u53d1\u53ea\u5355\u7528\u5411\u91cf\u53ec\u56de&#xff0c;\u5411\u91cf\u6a21\u578b\u64c5\u957f\u8bed\u4e49\u6a21\u7cca\u5339\u914d&#xff0c;\u53ef\u9047\u5230\u4e13\u4e1a\u672f\u8bed(k_1\u3001b)\u8bbe\u5907\u7f16\u53f7(k_1\u3001b)\u5185\u90e8\u9ed1\u8bdd\u65f6\u7ecf\u5e38\u53ec\u56de\u4e0d\u5230\u3002BM25\u5c31\u662f\u7528\u6765\u8865\u9f50\u8fd9\u4e2a\u77ed\u677f\u7684\u68c0\u7d22\u7b97\u6cd5\u3002<\/p>\n<h3>BM25\u662f\u4ec0\u4e48<\/h3>\n<p>\u5168\u79f0 Best Match 25&#xff0c;\u53ef\u4ee5\u7406\u89e3\u4e3a\u589e\u5f3a\u7248TF-IDF\u3002<br \/>\nTF-IDF\u53ea\u770b\u8bcd\u9891\u548c\u9006\u6587\u6863\u9891\u7387&#xff0c;\u5ffd\u7565\u6587\u6863\u957f\u5ea6\u3002BM25\u589e\u52a0\u4e24\u5927\u4f18\u5316&#xff1a;<\/p>\n<ul>\n<li>\u8bcd\u9891\u9971\u548c&#xff1a;\u5173\u952e\u8bcd\u91cd\u590d\u591a\u6b21&#xff0c;\u5206\u6570\u4e0d\u4f1a\u65e0\u9650\u4e0a\u6da8<\/li>\n<li>\u957f\u5ea6\u5f52\u4e00\u5316&#xff1a;\u540c\u7b49\u8bcd\u9891\u4e0b&#xff0c;\u77ed\u6587\u6863\u66f4\u5360\u4f18&#xff0c;\u907f\u514d\u957f\u6587\u6863\u5806\u8bcd\u5237\u5206<\/li>\n<\/ul>\n<p>\u6838\u5fc3\u4f5c\u7528&#xff1a;\u6839\u636e\u67e5\u8be2\u5173\u952e\u8bcd&#xff0c;\u7ed9\u6587\u6863\u6253\u5206\u5e76\u6309\u76f8\u5173\u6027\u6392\u5e8f\u3002<\/p>\n<h3>\u516c\u5f0f\u7b80\u5355\u7406\u89e3<\/h3>\n<p><span class=\"katex--display\"><span class=\"katex-display\"><span class=\"katex\"><span class=\"katex-mathml\">score(D,Q)&#061;\u2211i&#061;1nIDF(qi)\u22c5f(qi,D)\u22c5(k1&#043;1)f(qi,D)&#043;k1\u22c5(1\u2212b&#043;b\u22c5\u2223D\u2223avgdl)<br \/>\n\\\\text{score}(D,Q) &#061; \\\\sum_{i&#061;1}^{n} \\\\text{IDF}(q_i) \\\\cdot \\\\frac{f(q_i,D) \\\\cdot (k_1&#043;1)}{f(q_i,D) &#043; k_1 \\\\cdot (1 &#8211; b &#043; b \\\\cdot \\\\frac{|D|}{\\\\text{avgdl}})}<br \/>\n<\/span><span class=\"katex-html\"><span class=\"base\"><span class=\"strut\" style=\"height: 1em;vertical-align: -0.25em\"><\/span><span class=\"mord text\"><span class=\"mord\">score<\/span><\/span><span class=\"mopen\">(<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mpunct\">,<\/span><span class=\"mspace\" style=\"margin-right: 0.1667em\"><\/span><span class=\"mord mathnormal\">Q<\/span><span class=\"mclose\">)<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><span class=\"mrel\">&#061;<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><\/span><span class=\"base\"><span class=\"strut\" style=\"height: 2.9291em;vertical-align: -1.2777em\"><\/span><span class=\"mop op-limits\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 1.6514em\"><span class=\"\" style=\"top: -1.8723em;margin-left: 0em\"><span class=\"pstrut\" style=\"height: 3.05em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\"><span class=\"mord mathnormal mtight\">i<\/span><span class=\"mrel mtight\">&#061;<\/span><span class=\"mord mtight\">1<\/span><\/span><\/span><\/span><span class=\"\" style=\"top: -3.05em\"><span class=\"pstrut\" style=\"height: 3.05em\"><\/span><span class=\"\"><span class=\"mop op-symbol large-op\">\u2211<\/span><\/span><\/span><span class=\"\" style=\"top: -4.3em;margin-left: 0em\"><span class=\"pstrut\" style=\"height: 3.05em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\"><span class=\"mord mathnormal mtight\">n<\/span><\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 1.2777em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><span class=\"mspace\" style=\"margin-right: 0.1667em\"><\/span><span class=\"mord text\"><span class=\"mord\">IDF<\/span><\/span><span class=\"mopen\">(<\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0359em\">q<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3117em\"><span class=\"\" style=\"top: -2.55em;margin-left: -0.0359em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\">i<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><span class=\"mclose\">)<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">\u22c5<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><\/span><span class=\"base\"><span class=\"strut\" style=\"height: 2.8081em;vertical-align: -1.3811em\"><\/span><span class=\"mord\"><span class=\"mopen nulldelimiter\"><\/span><span class=\"mfrac\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 1.427em\"><span class=\"\" style=\"top: -2.11em\"><span class=\"pstrut\" style=\"height: 3.01em\"><\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.1076em\">f<\/span><span class=\"mopen\">(<\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0359em\">q<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3117em\"><span class=\"\" style=\"top: -2.55em;margin-left: -0.0359em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\">i<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><span class=\"mpunct\">,<\/span><span class=\"mspace\" style=\"margin-right: 0.1667em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mclose\">)<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">&#043;<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0315em\">k<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3011em\"><span class=\"\" style=\"top: -2.55em;margin-left: -0.0315em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\">1<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">\u22c5<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mopen\">(<\/span><span class=\"mord\">1<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">\u2212<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mord mathnormal\">b<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">&#043;<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mord mathnormal\">b<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">\u22c5<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mord\"><span class=\"mopen nulldelimiter\"><\/span><span class=\"mfrac\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 1.01em\"><span class=\"\" style=\"top: -2.655em\"><span class=\"pstrut\" style=\"height: 3em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\"><span class=\"mord text mtight\"><span class=\"mord mtight\">avgdl<\/span><\/span><\/span><\/span><\/span><span class=\"\" style=\"top: -3.23em\"><span class=\"pstrut\" style=\"height: 3em\"><\/span><span class=\"frac-line\" style=\"border-bottom-width: 0.04em\"><\/span><\/span><span class=\"\" style=\"top: -3.485em\"><span class=\"pstrut\" style=\"height: 3em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\"><span class=\"mord mtight\">\u2223<\/span><span class=\"mord mathnormal mtight\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mord mtight\">\u2223<\/span><\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.4811em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><span class=\"mclose nulldelimiter\"><\/span><\/span><span class=\"mclose\">)<\/span><\/span><\/span><span class=\"\" style=\"top: -3.24em\"><span class=\"pstrut\" style=\"height: 3.01em\"><\/span><span class=\"frac-line\" style=\"border-bottom-width: 0.04em\"><\/span><\/span><span class=\"\" style=\"top: -3.687em\"><span class=\"pstrut\" style=\"height: 3.01em\"><\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.1076em\">f<\/span><span class=\"mopen\">(<\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0359em\">q<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3117em\"><span class=\"\" style=\"top: -2.55em;margin-left: -0.0359em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\">i<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><span class=\"mpunct\">,<\/span><span class=\"mspace\" style=\"margin-right: 0.1667em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mclose\">)<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">\u22c5<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mopen\">(<\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0315em\">k<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3011em\"><span class=\"\" style=\"top: -2.55em;margin-left: -0.0315em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\">1<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">&#043;<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mord\">1<\/span><span class=\"mclose\">)<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 1.3811em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><span class=\"mclose nulldelimiter\"><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<ul>\n<li>IDF&#xff1a;\u8bcd\u8d8a\u7a00\u6709&#xff0c;\u6743\u91cd\u8d8a\u9ad8<\/li>\n<li><span class=\"katex--inline\"><span class=\"katex\"><span class=\"katex-mathml\">k1k_1<\/span><span class=\"katex-html\"><span class=\"base\"><span class=\"strut\" style=\"height: 0.8444em;vertical-align: -0.15em\"><\/span><span class=\"mord\"><span class=\"mord mathnormal\" style=\"margin-right: 0.0315em\">k<\/span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.3011em\"><span class=\"\" style=\"top: -2.55em;margin-left: -0.0315em;margin-right: 0.05em\"><span class=\"pstrut\" style=\"height: 2.7em\"><\/span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\">1<\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.15em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>&#xff08;\u9ed8\u8ba41.2&#xff09;&#xff1a;\u63a7\u5236\u8bcd\u9891\u9971\u548c<\/li>\n<li><span class=\"katex--inline\"><span class=\"katex\"><span class=\"katex-mathml\">bb<\/span><span class=\"katex-html\"><span class=\"base\"><span class=\"strut\" style=\"height: 0.6944em\"><\/span><span class=\"mord mathnormal\">b<\/span><\/span><\/span><\/span><\/span>&#xff08;\u9ed8\u8ba40.75&#xff09;(k_1\u3001b)avgdl&#xff1a;\u6587\u6863\u957f\u5ea6\u4fee\u6b63<\/li>\n<\/ul>\n<h3>RAG\u5de5\u7a0b3\u79cd\u7528\u6cd5<\/h3>\n<li>RRF\u53cc\u8def\u878d\u5408&#xff08;\u4e3b\u6d41\u65b9\u6848&#xff09;<br \/>\nBM25\u6293\u7cbe\u51c6\u5173\u952e\u8bcd&#xff1b;\u5411\u91cf\u53ec\u56de\u8d1f\u8d23\u8bed\u4e49\u540c\u4e49\u62d3\u5c55&#xff0c;\u4e24\u8def\u5408\u5e76&#xff0c;\u663e\u8457\u63d0\u5347\u53ec\u56de\u8d28\u91cf\u3002<\/li>\n<li>\u5411\u91cf\u6a21\u578b\u515c\u5e95<br \/>\n\u5782\u76f4\u9886\u57df\u5411\u91cf\u6a21\u578b\u8bc6\u522b\u7f29\u5199(k_1\u3001b)\u5c0f\u4f17\u540d\u8bcd\u5bb9\u6613\u8dd1\u504f&#xff0c;BM25\u4fdd\u8bc1\u6838\u5fc3\u5173\u952e\u8bcd\u6587\u6863\u4e0d\u6f0f\u3002<\/li>\n<li>\u5206\u5757\u9884\u7b5b\u9009<br \/>\n\u5148\u7528BM25\u7c97\u7b5b\u6587\u672c\u5757&#xff0c;\u51cf\u5c11\u5411\u91cf\u8ba1\u7b97\u91cf&#xff0c;\u63d0\u901f\u964d\u6210\u672c\u3002<\/li>\n<h3>\u843d\u5730\u907f\u5751<\/h3>\n<li>k\u2081\u3001b \u7684\u9ed8\u8ba4\u53c2\u6570\u4e0d\u662f\u4e07\u80fd\u7684&#xff0c;\u9700\u8981\u7ed3\u5408\u6587\u6863\u5206\u5e03\u8c03\u53c2<\/li>\n<li>BM25\u53ea\u6709\u5b57\u9762\u5339\u914d&#xff0c;\u4e0d\u80fd\u5355\u72ec\u66ff\u4ee3\u5411\u91cf\u68c0\u7d22<\/li>\n<li>\u4e2d\u6587\u573a\u666f\u52a1\u5fc5\u505a\u597d\u5206\u8bcd\u3001\u505c\u7528\u8bcd\u8fc7\u6ee4<\/li>\n<h3>\u603b\u7ed3<\/h3>\n<p>BM25\u548c\u5411\u91cf\u68c0\u7d22\u662f\u4e92\u8865\u5173\u7cfb&#xff0c;\u8bed\u4e49&#043;\u5173\u952e\u8bcd\u53cc\u68c0\u7d22&#xff0c;\u662fRAG\u4eceDemo\u8d70\u5411\u751f\u4ea7\u7684\u5173\u952e&#xff0c;\u4e5f\u662f\u9762\u8bd5\u9ad8\u9891\u8003\u70b9\u3002<\/p>\n<h3>\u5199\u5728\u6700\u540e<\/h3>\n<p>\u60f3\u8981\u7cfb\u7edf\u5b66\u4e60\u5927\u6a21\u578b\u5e94\u7528\u5f00\u53d1\u77e5\u8bc6\u3001\u6216\u8005\u60f3\u8f6c\u884c\u7684\u670b\u53cb&#xff0c;\u6b22\u8fce\u4e86\u89e3\u8d2d\u4e70\u4e3b\u9875\u300a\u5927\u6a21\u578b\u5165\u95e8\u7cbe\u54c1\u8bfe &#xff0b;\u7b80\u5386\u548c\u9762\u8bd5\u6307\u5bfc\u300b&#xff08;\u5bf9\u4e8e\u5c0f\u767d\u548c\u60f3\u8f6c\u884c\u5c0f\u4f19\u4f34\u800c\u5df2&#xff0c;\u5982\u679c\u6ca1\u6709\u7b80\u5386\u548c\u9762\u8bd5\u8f85\u5bfc\u662f\u5f88\u96be\u901a\u8fc7\u9762\u8bd5\u7684&#xff09;&#xff0c;\u8bfe\u7a0b\u5185\u5bb9\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u7eaf\u5e72\u8d27\u4e00\u4e2a\u6708\u5b66\u5b8c&#xff08;\u6ca1\u6709\u5197\u4f59\u7684\u7406\u8bba&#xff0c;\u9879\u76ee\u90fd\u662f\u5927\u578b\u4f01\u4e1a\u751f\u4ea7\u9879\u76ee&#xff0c;\u975e\u6559\u5b66demo&#xff09;\u3002<\/li>\n<li>\u9879\u76ee\u8986\u76d6 RAG\u3001\u667a\u80fd\u4f53\u3001Lora\u5fae\u8c03\u5b9e\u6218\u9879\u76ee\u3001VLLM\u79c1\u6709\u5316\u90e8\u7f72\u5927\u6a21\u578b\u3001\u6a21\u578b\u538b\u7f29&#xff08;\u526a\u679d\u3001\u91cf\u5316\u3001\u84b8\u998f&#xff09;\u3002<\/li>\n<li>\u52a9\u529b\u4e30\u5bcc\u4e2a\u4eba\u9879\u76ee\u6280\u672f\u6808\u548c\u7b80\u5386\u9762\u8bd5\u6c42\u804c\u3002\u8bfe\u7a0b\u5730\u5740&#xff1a;https:\/\/edu.csdn.net\/course\/detail\/41422<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5f88\u591aRAG\u5f00\u53d1\u53ea\u5355\u7528\u5411\u91cf\u53ec\u56de&#xff0c;\u5411\u91cf\u6a21\u578b\u64c5\u957f\u8bed\u4e49\u6a21\u7cca\u5339\u914d&#xff0c;\u53ef\u9047\u5230\u4e13\u4e1a\u672f\u8bed(k_1\u3001b)\u8bbe\u5907\u7f16\u53f7(k_1\u3001b)\u5185\u90e8\u9ed1\u8bdd\u65f6\u7ecf\u5e38\u53ec\u56de\u4e0d\u5230\u3002BM25\u5c31\u662f\u7528\u6765\u8865\u9f50\u8fd9\u4e2a\u77ed\u677f\u7684\u68c0\u7d22\u7b97\u6cd5\u3002<br \/>\nBM25\u662f\u4ec0\u4e48<br \/>\n\u5168\u79f0 Best Match 25&#xff0c;\u53ef\u4ee5\u7406\u89e3\u4e3a\u589e\u5f3a\u7248TF-IDF\u3002<br \/>\nTF-IDF\u53ea\u770b\u8bcd\u9891\u548c\u9006\u6587\u6863\u9891\u7387&#xff0c;\u5ffd\u7565\u6587\u6863\u957f\u5ea6\u3002BM25\u589e\u52a0\u4e24\u5927\u4f18\u5316&#xff1a;<br \/>\n\u8bcd\u9891\u9971\u548c&#xff1a;\u5173\u952e\u8bcd\u91cd\u590d\u591a\u6b21&#xff0c;\u5206\u6570\u4e0d\u4f1a\u65e0\u9650\u4e0a\u6da8\u957f\u5ea6\u5f52\u4e00\u5316&amp;#<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13901,13903,13902,4119,5590],"topic":[],"class_list":["post-121481","post","type-post","status-publish","format-standard","hentry","category-server","tag-bm25","tag-13903","tag-13902","tag-rag","tag-5590"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>RAG\u522b\u53ea\u4f9d\u8d56\u5411\u91cf\u53ec\u56de\uff01BM25\u68c0\u7d22\u5feb\u901f\u4e0a\u624b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/121481.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RAG\u522b\u53ea\u4f9d\u8d56\u5411\u91cf\u53ec\u56de\uff01BM25\u68c0\u7d22\u5feb\u901f\u4e0a\u624b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5f88\u591aRAG\u5f00\u53d1\u53ea\u5355\u7528\u5411\u91cf\u53ec\u56de&#xff0c;\u5411\u91cf\u6a21\u578b\u64c5\u957f\u8bed\u4e49\u6a21\u7cca\u5339\u914d&#xff0c;\u53ef\u9047\u5230\u4e13\u4e1a\u672f\u8bed(k_1\u3001b)\u8bbe\u5907\u7f16\u53f7(k_1\u3001b)\u5185\u90e8\u9ed1\u8bdd\u65f6\u7ecf\u5e38\u53ec\u56de\u4e0d\u5230\u3002BM25\u5c31\u662f\u7528\u6765\u8865\u9f50\u8fd9\u4e2a\u77ed\u677f\u7684\u68c0\u7d22\u7b97\u6cd5\u3002 BM25\u662f\u4ec0\u4e48 \u5168\u79f0 Best Match 25&#xff0c;\u53ef\u4ee5\u7406\u89e3\u4e3a\u589e\u5f3a\u7248TF-IDF\u3002 TF-IDF\u53ea\u770b\u8bcd\u9891\u548c\u9006\u6587\u6863\u9891\u7387&#xff0c;\u5ffd\u7565\u6587\u6863\u957f\u5ea6\u3002BM25\u589e\u52a0\u4e24\u5927\u4f18\u5316&#xff1a; \u8bcd\u9891\u9971\u548c&#xff1a;\u5173\u952e\u8bcd\u91cd\u590d\u591a\u6b21&#xff0c;\u5206\u6570\u4e0d\u4f1a\u65e0\u9650\u4e0a\u6da8\u957f\u5ea6\u5f52\u4e00\u5316&amp;#\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/121481.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-02T14:16:36+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/121481.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/121481.html\",\"name\":\"RAG\u522b\u53ea\u4f9d\u8d56\u5411\u91cf\u53ec\u56de\uff01BM25\u68c0\u7d22\u5feb\u901f\u4e0a\u624b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-02T14:16:36+00:00\",\"dateModified\":\"2026-11-02T14:16:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/121481.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/121481.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/121481.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RAG\u522b\u53ea\u4f9d\u8d56\u5411\u91cf\u53ec\u56de\uff01BM25\u68c0\u7d22\u5feb\u901f\u4e0a\u624b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"RAG\u522b\u53ea\u4f9d\u8d56\u5411\u91cf\u53ec\u56de\uff01BM25\u68c0\u7d22\u5feb\u901f\u4e0a\u624b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/121481.html","og_locale":"zh_CN","og_type":"article","og_title":"RAG\u522b\u53ea\u4f9d\u8d56\u5411\u91cf\u53ec\u56de\uff01BM25\u68c0\u7d22\u5feb\u901f\u4e0a\u624b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5f88\u591aRAG\u5f00\u53d1\u53ea\u5355\u7528\u5411\u91cf\u53ec\u56de&#xff0c;\u5411\u91cf\u6a21\u578b\u64c5\u957f\u8bed\u4e49\u6a21\u7cca\u5339\u914d&#xff0c;\u53ef\u9047\u5230\u4e13\u4e1a\u672f\u8bed(k_1\u3001b)\u8bbe\u5907\u7f16\u53f7(k_1\u3001b)\u5185\u90e8\u9ed1\u8bdd\u65f6\u7ecf\u5e38\u53ec\u56de\u4e0d\u5230\u3002BM25\u5c31\u662f\u7528\u6765\u8865\u9f50\u8fd9\u4e2a\u77ed\u677f\u7684\u68c0\u7d22\u7b97\u6cd5\u3002 BM25\u662f\u4ec0\u4e48 \u5168\u79f0 Best Match 25&#xff0c;\u53ef\u4ee5\u7406\u89e3\u4e3a\u589e\u5f3a\u7248TF-IDF\u3002 TF-IDF\u53ea\u770b\u8bcd\u9891\u548c\u9006\u6587\u6863\u9891\u7387&#xff0c;\u5ffd\u7565\u6587\u6863\u957f\u5ea6\u3002BM25\u589e\u52a0\u4e24\u5927\u4f18\u5316&#xff1a; \u8bcd\u9891\u9971\u548c&#xff1a;\u5173\u952e\u8bcd\u91cd\u590d\u591a\u6b21&#xff0c;\u5206\u6570\u4e0d\u4f1a\u65e0\u9650\u4e0a\u6da8\u957f\u5ea6\u5f52\u4e00\u5316&amp;#","og_url":"https:\/\/www.wsisp.com\/helps\/121481.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-02T14:16:36+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/121481.html","url":"https:\/\/www.wsisp.com\/helps\/121481.html","name":"RAG\u522b\u53ea\u4f9d\u8d56\u5411\u91cf\u53ec\u56de\uff01BM25\u68c0\u7d22\u5feb\u901f\u4e0a\u624b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-02T14:16:36+00:00","dateModified":"2026-11-02T14:16:36+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/121481.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/121481.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/121481.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"RAG\u522b\u53ea\u4f9d\u8d56\u5411\u91cf\u53ec\u56de\uff01BM25\u68c0\u7d22\u5feb\u901f\u4e0a\u624b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/121481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=121481"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/121481\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=121481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=121481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=121481"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=121481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}