{"id":5548,"date":"2025-06-17T14:44:56","date_gmt":"2025-06-17T06:44:56","guid":{"rendered":"http:\/\/xinblog.ltd\/?p=5548"},"modified":"2025-06-21T15:15:42","modified_gmt":"2025-06-21T07:15:42","slug":"%e5%9f%ba%e7%a1%80%e6%95%b0%e5%ad%a6%e8%af%be30-%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e%e7%9a%84%e6%9e%84%e5%bb%ba","status":"publish","type":"post","link":"http:\/\/xinblog.ltd\/?p=5548","title":{"rendered":"\u57fa\u7840\u6570\u5b66\u8bfe30-\u641c\u7d22\u5f15\u64ce\u7684\u6784\u5efa"},"content":{"rendered":"<p>\u57fa\u7840\u6570\u5b66\u8bfe30\u641c\u7d22\u5f15\u64ce\u7684\u6784\u5efa<\/p>\n<p>\u672c\u6b21\u6211\u4eec\u8bf4\u4e0b\u5982\u4f55\u6784\u5efa\u4e00\u4e2a\u641c\u7d22\u5f15\u64ce\uff0c\u641c\u7d22\u5f15\u64ce\u6700\u5173\u952e\u7684\u70b9\u5728\u4e8e\u9700\u8981\u6ee1\u8db3\u7528\u6237\u7684\u641c\u7d22\u9700\u6c42\u3002\u6700\u4e3a\u5e38\u89c1\u7684\u6a21\u578b\u5c31\u662f\u5e03\u5c14\u6a21\u578b\uff0c\u53ea\u9700\u8981\u8003\u8651\u5355\u8bcd\u662f\u4e0d\u662f\u51fa\u73b0\u5728\u6587\u6863\u4e2d\uff0c\u5982\u679c\u51fa\u73b0\u4e86\u5c31\u8fd4\u56de\uff0c\u4e0d\u51fa\u73b0\u5c31\u4e0d\u8fd4\u56de\u3002\u5728\u6b64\u57fa\u7840\u4e0a\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528\u5411\u91cf\u7a7a\u95f4\u6a21\u578b\u6765\u8861\u91cf\u6587\u6863\u548c\u7528\u6237\u67e5\u8be2\u4e4b\u95f4\u7684\u76f8\u4f3c\u5ea6\uff0c\u786e\u4fdd\u4e24\u8005\u662f\u76f8\u5173\u7684\u3002<\/p>\n<p>\u5728\u6587\u672c\u641c\u7d22\u7cfb\u7edf\u4e2d\uff0c\u5f80\u5f80\u5305\u542b\u4e24\u4e2a\u91cd\u8981\u7684\u6a21\u5757\uff0c\u79bb\u7ebf\u7684\u9884\u5904\u7406\u548c\u5728\u7ebf\u7684\u67e5\u8be2\u5206\u89e3\u3002\u6700\u4e3a\u7b80\u5355\u7684\u5b9e\u73b0\u5982\u4e0b\u3002<\/p>\n<p>\u9996\u5148\u662f\u79bb\u7ebf\u9884\u5904\u7406\uff0c\u4e5f\u5c31\u662f\u7d22\u5f15\u9636\u6bb5\uff0c\u4e3b\u8981\u662f\u6587\u672c\u9884\u5904\u7406\u548c\u5012\u6392\u7d22\u5f15\u6784\u5efa\u4e24\u4e2a\u6b65\u9aa4\uff0c\u5176\u4e2d\u6587\u672c\u9884\u5904\u7406\u5f88\u7b80\u5355\u5c31\u662f\u5206\u8bcd\uff0c\u79fb\u9664\u505c\u7528\u8bcd\uff0c\u53d6\u8bcd\u5e72\uff0c\u5f52\u4e00\u5316\uff0c\u6269\u5145\u540c\u4e49\u8bcd\u3002<\/p>\n<p>\u7136\u540e\u8fdb\u884c\u7d22\u5f15\u8ba1\u7b97\uff0c\u5c06\u51fa\u73b0\u7684\u8bcd\u5e72\u4f5c\u4e3akey\uff0c\u51fa\u73b0\u7684\u6587\u6863\u96c6\u5408\u4f5c\u4e3a\u503c\u8fdb\u884c\u4fdd\u5b58\u3002<\/p>\n<p>\u5176\u6b21\u662f\u5728\u7ebf\u67e5\u8be2\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u4e5f\u662f\u73b0\u5c06\u7528\u6237\u7684\u8f93\u5165\u8f6c\u6362\u4e3a\u5355\u8bcd\uff0c\u7136\u540e\u6839\u636e\u5355\u8bcd\uff0c\u68c0\u7d22\u51fa\u6587\u6863\uff0c\u8fdb\u884c\u5339\u914d\u3002<\/p>\n<p>\u53ea\u4e0d\u8fc7\u8ba1\u7b97\u7684\u65f6\u5019\uff0c\u5e03\u5c14\u6a21\u578b\u53ea\u5224\u65ad\u662f\u5426\u5b58\u5728\uff0c\u5411\u91cf\u7a7a\u95f4\u6a21\u578bVSM\u5219\u662f\u8ba1\u7b97\u67e5\u8be2\u5411\u91cf\u548c\u5f85\u67e5\u8be2\u5411\u91cf\u7684\u4f59\u5f26\u5939\u89d2\u3002\u8bed\u8a00\u6a21\u578b\u5219\u662f\u8ba1\u7b97\u5339\u914d\u7684\u8d1d\u53f6\u65af\u6982\u7387\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"713\" height=\"528\" class=\"wp-image-5549\" src=\"http:\/\/xinblog.ltd\/wp-content\/uploads\/2025\/01\/word-image-225.png\" srcset=\"http:\/\/xinblog.ltd\/wp-content\/uploads\/2025\/01\/word-image-225.png 713w, http:\/\/xinblog.ltd\/wp-content\/uploads\/2025\/01\/word-image-225-300x222.png 300w\" sizes=\"(max-width: 713px) 100vw, 713px\" \/><\/p>\n<p>\u5728\u5b9e\u9645\u843d\u5730\u7684\u65f6\u5019\uff0c\u5f80\u5f80\u4e3a\u4e86\u6ee1\u8db3\u4e0a\u8ff0\u7684\u8981\u6c42\uff0c\u6211\u4eec\u5728\u5012\u6392\u7d22\u5f15\u4e2d\uff0ckey\u5bf9\u5e94\u7684\u6570\u7ec4\u4e2d\u5b58\u653e\u7684\u5f80\u5f80\u662f\u5bf9\u8c61\uff0c\u6bd4\u5982\u8bcd\u9891 tf\uff0c \u8bcd\u9891-\u9006\u6587\u6863\u9891\u7387 tf-idf\uff0c\u8fd8\u6709\u8bf8\u5982\u8bcd\u6761\u51fa\u73b0\u7684\u6458\u8981\u3002<\/p>\n<p>\u5728\u5229\u7528\u5177\u6709\u8fd9\u4e9b\u4fe1\u606f\u7684\u5bf9\u8c61\u5f62\u6210\u5012\u6392\u7d22\u5f15\u540e\u3002<\/p>\n<p>\u540e\u7eed\u5224\u65ad\u76f8\u4f3c\u5ea6\u5c31\u4e0d\u96be\u4e86\uff0c\u7531\u5982\u4e0b\u7684\u516c\u5f0f\u7ec4\u6210<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"488\" height=\"244\" class=\"wp-image-5550\" src=\"http:\/\/xinblog.ltd\/wp-content\/uploads\/2025\/01\/word-image-226.png\" srcset=\"http:\/\/xinblog.ltd\/wp-content\/uploads\/2025\/01\/word-image-226.png 488w, http:\/\/xinblog.ltd\/wp-content\/uploads\/2025\/01\/word-image-226-300x150.png 300w\" sizes=\"(max-width: 488px) 100vw, 488px\" \/><\/p>\n<p>\u5982\u679c\u76f4\u63a5\u8fdb\u884c\u8ba1\u7b97\uff0c\u90a3\u4e48\u6211\u4eec\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u76f8\u5bf9\u8f83\u9ad8<\/p>\n<p>\u4f46\u662f\u5982\u679c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5012\u6392\u7d22\u5f15\u8fdb\u884c\u63d0\u524d\u7684\u89c4\u907f\uff0c\u53ef\u4ee5\u5927\u5927\u51cf\u5c11\u8ba1\u7b97\u91cf\u3002<\/p>\n<p>\u6211\u4eec\u4e4b\u524d\u8bbe\u8ba1\u7684\u5012\u6392\u7d22\u5f15\u4fdd\u5b58\u4e86tf-idf\u7684\u4fe1\u606f\uff0c\u6240\u4ee5\u53ef\u4ee5\u76f4\u63a5\u83b7\u53d6\u5230\u5206\u5b50\u90e8\u5206\uff0c\u81f3\u4e8e\u5206\u6bcd\u3002<\/p>\n<p>\u5219\u662f\u7528\u6237\u67e5\u8be2\u7684\u5411\u91cf\u548c\u6587\u6863\u5411\u91cf\u7684\u8303\u6570\uff0c\u76f8\u5bf9\u6765\u8bf4\u6570\u91cf\u8f83\u5c11\u3002<\/p>\n<p>\u8fd9\u4e2a\u5c31\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u641c\u7d22\u7cfb\u7edf\u7684\u5efa\u7acb<\/p>\n<p>\u4e4b\u540e\u8fd8\u6709\u4e00\u4e2a\u95ee\u9898\uff0c\u5982\u679c\u6211\u4eec\u7684\u641c\u7d22\u7cfb\u7edf\u662f\u5efa\u7acb\u5728\u7535\u5546\u5e73\u53f0\u7684\u5462\uff1f<\/p>\n<p>\u56e0\u4e3a\u7535\u5546\u5e73\u53f0\u975e\u5e38\u7684\u8bb2\u7a76\u7cbe\u51c6\u3002\u8fd9\u5c31\u9700\u8981\u4ece\u51e0\u4e2a\u65b9\u9762\u627e\u4e0b\u539f\u56e0<\/p>\n<ol>\n<li>\u5546\u54c1\u7684\u6807\u9898\u6bd4\u8f83\u77ed\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5546\u54c1\u7684\u6807\u9898\uff0c\u540d\u79f0\u5c31\u6210\u4e86\u4e3b\u8981\u641c\u7d22\u5c5e\u6027\uff0c\u9700\u8981\u53bb\u9664\u5546\u54c1\u7684\u7b80\u4ecb\u7684\u4fe1\u606f<\/li>\n<li>\u5173\u952e\u8bcd\u5f80\u5f80\u51fa\u73b0\u5728\u4e86\u6807\u9898\u7b49\u5730\u65b9\uff0c\u8003\u8651\u9891\u7387\u5f80\u5f80\u4e0d\u592a\u9700\u8981\uff0c\u6240\u4ee5\u53ef\u4ee5\u51cf\u5c11<\/li>\n<li>\u7528\u6237\u7684\u641c\u7d22\u5f80\u5f80\u6bd4\u8f83\u77ed\uff0c\u6240\u4ee5\u66f4\u9700\u8981\u5173\u952e\u8bcd\u3002<\/li>\n<\/ol>\n<p>\u9488\u5bf9\u4e0a\u8ff0\u7684\u95ee\u9898\uff0c\u6211\u4eec\u4e3b\u8981\u8fdb\u884c\u51e0\u70b9\u7684\u4f18\u5316<\/p>\n<ol>\n<li>\u9996\u5148\u53ea\u4ece\u5546\u54c1\u7684\u6807\u9898\u4ee5\u53ca\u526f\u6807\u9898\u4e2d\u53d6\u51fa\u6570\u636e\u3002<\/li>\n<li>\u5229\u7528\u6734\u7d20\u8d1d\u53f6\u65af\u5904\u7406\u5546\u54c1\uff0c\u4ece\u800c\u786e\u5b9a\u7528\u6237\u7684\u5173\u952e\u8bcd\u5bf9\u5e94\u54ea\u4e9b\u5546\u54c1\uff0c\u5e76\u7ed9\u51fa\u4e00\u4e2a\u6392\u5e8f\u3002<\/li>\n<li>\u5229\u7528\u7528\u6237\u7684\u540e\u7eed\u64cd\u4f5c\uff0c\u8fdb\u884c\u987a\u5e8f\u4e0a\u7684\u8c03\u6574\u3002\u6bd4\u5982\u7528\u6237\u8f93\u5165\u4e86\u5496\u5561\uff0c\u7136\u540e\u6700\u591a\u7684\u4e0b\u5355\u6570\u91cf\u6216\u52a0\u5165\u8d2d\u7269\u8f66\u7684\u662f\u51b2\u996e\u5496\u5561\uff0c\u5496\u5561\u8c46\uff0c\u5496\u5561\u996e\u6599\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u5c06\u8fd9\u4e2a\u5206\u7c7b\u6392\u5728\u6700\u524d\u9762\u3002<\/li>\n<\/ol>\n<p>\u5728\u4e0a\u8ff0\u7684\u51e0\u70b9\u4f18\u5316\u4e2d<\/p>\n<p>\u6734\u7d20\u8d1d\u53f6\u65af\u53ef\u4ee5\u5229\u7528\u5927\u91cf\u7684\u6807\u6ce8\u6570\u636e\u8fdb\u884c\u8ba1\u7b97\uff0c\u4f46\u662f\u65e0\u6cd5\u5f88\u597d\u7684\u533a\u5206\u5173\u952e\u8bcd\u7684\u5206\u7c7b\uff0c\u6bd4\u5982\u5496\u5561\u8272\u8863\u670d\u548c\u5496\u5561\u7684\u533a\u522b\u3002<\/p>\n<p>\u800c\u5bf9\u4e8e\u7528\u6237\u540e\u7eed\u64cd\u4f5c\u7684\u7edf\u8ba1\uff0c\u5219\u6709\u4e00\u4e2a\u51b7\u542f\u52a8\u7684\u95ee\u9898\u3002<\/p>\n<p>\u6240\u4ee5\u5e94\u8be5\u7efc\u5408\u4f7f\u7528\u3002<\/p>\n<p>P(C\u2223query)=w1\u200b\u22c5P1\u200b(C\u2223query)+w2\u200b\u22c5P2\u200b(C\u2223query)<\/p>\n<p>P1\u662f\u5bf9\u5e94\u7684\u6982\u7387\uff0cw1\u662f\u7b2c\u4e00\u79cd\u7684\u6743\u91cd\u3002<\/p>\n<p>\u6839\u636e\u4e0d\u65ad\u5730\u5b66\u4e60\uff0c\u8ba9\u5176\u4e2dw2 p2\u7684\u6bd4\u91cd\u8d8a\u6765\u8d8a\u5927\u3002<\/p>\n<p>\u90a3\u4e48\u6211\u4eec\u5c31\u53ef\u4ee5\u4ee5ElasticSearch\u4e3a\u4f8b\uff0c\u8bb2\u4e00\u4e0b\u5982\u4f55\u8fdb\u884c\u5206\u7c7b\u7ed3\u679c\u7684\u6392\u5e8f\u3002<\/p>\n<p>ElasticSearch\u91c7\u53d6\u4e86\u7c7b\u4f3c\u5411\u91cf\u7684\u7a7a\u95f4\u6a21\u578b\u7684\u65b9\u5f0f\u8fdb\u884c\u6392\u5e8f\uff0c\u4f46\u662f\u8fd9\u91cc\u6211\u4eec\u5229\u7528es\u63d0\u4f9b\u7684Similarty\u8fdb\u884c\u7edf\u4e00\u5f97\u5206\u3002\u7136\u540e\u5229\u7528\u540e\u7eed\u7528\u6237\u884c\u4e3a\u8fdb\u884c\u884c\u4e3a\u7684\u4f18\u5316\u3002<\/p>\n<p>\u6bd4\u5982\u67e5\u8be2\u5496\u5561\uff0c\u5496\u5561\u996e\u6599\u7684\u5f97\u5206\u5e94\u8be5\u662f0.85\uff0c\u5496\u5561\u8272\u8863\u670d\u548c\u5496\u5561\u5473\u9999\u85b0\u5e94\u8be5\u662f0.15\u3002\u6240\u4ee5\u6211\u4eec\u5c31\u53ef\u4ee5\u7ec4\u6210\u5982\u4e0b\u7684\u67e5\u8be2json\u65b9\u4fbfES\u8fdb\u884c\u6392\u5e8f\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<td>{<\/p>\n<p>&#8220;query&#8221;: {<\/p>\n<p>&#8220;bool&#8221;: {<\/p>\n<p>&#8220;must&#8221;: {<\/p>\n<p>&#8220;match_all&#8221;: {<\/p>\n<p>}<\/p>\n<p>},<\/p>\n<p>&#8220;should&#8221;: [<\/p>\n<p>{<\/p>\n<p>&#8220;match&#8221;: {<\/p>\n<p>&#8220;category_name&#8221;: {<\/p>\n<p>&#8220;query&#8221;: &#8220;\u5496\u5561\u996e\u6599&#8221;,<\/p>\n<p>&#8220;boost&#8221;: 0.85<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>},<\/p>\n<p>{<\/p>\n<p>&#8220;match&#8221;: {<\/p>\n<p>&#8220;category_name&#8221;: {<\/p>\n<p>&#8220;query&#8221;: &#8220;\u5496\u5561\u8272\u8863\u670d&#8221;,<\/p>\n<p>&#8220;boost&#8221;: 0.15<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>},<\/p>\n<p>{<\/p>\n<p>&#8220;match&#8221;: {<\/p>\n<p>&#8220;category_name&#8221;: {<\/p>\n<p>&#8220;query&#8221;: &#8220;\u5496\u5561\u5473\u9999\u85b0&#8221;,<\/p>\n<p>&#8220;boost&#8221;: 0.15<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>],<\/p>\n<p>&#8220;filter&#8221;: {<\/p>\n<p>&#8220;term&#8221;: {&#8220;listing_title&#8221; : &#8220;\u5496\u5561&#8221;}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5229\u7528\u5176\u4e2d\u7684boost\u5b57\u6bb5\uff0c\u8fdb\u884c\u4e86\u67e5\u8be2\u7ed3\u679c\u7684\u6392\u5e8f\u3002\u4ece\u800c\u8ba9\u5496\u5561\u996e\u6599\u6392\u5230\u4e86\u6700\u524d\u9762\u3002<\/p>\n<p>\u6700\u540e\u603b\u7ed3\u4e0b\uff0c\u76f8\u5173\u6027\u641c\u7d22\u5f80\u5f80\u662f\u641c\u7d22\u5f15\u64ce\u7684\u6838\u5fc3\u6a21\u5757\u3002\u5176\u4e2d\u6211\u4eec\u5206\u4e3a\u4e86\u4e24\u5927\u6a21\u5757\uff0c\u6570\u636e\u9884\u5904\u7406\u548c\u7528\u6237\u67e5\u8be2\u3002\u5728\u5176\u4e2d\uff0c\u6211\u4eec\u8fd8\u4f1a\u7528\u5230\u8bf8\u5982\u5411\u91cf\u7a7a\u95f4\u6a21\u578b\uff0c\u6982\u7387\u6a21\u578b\u7b49\u5e38\u89c1\u6a21\u578b\u3002<\/p>\n<p>\u5e76\u5229\u7528\u540e\u7eed\u7528\u6237\u7684\u64cd\u4f5c\u8bb0\u6027\u4f18\u5316\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u57fa\u7840\u6570\u5b66\u8bfe30\u641c\u7d22\u5f15\u64ce\u7684\u6784\u5efa  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[],"_links":{"self":[{"href":"http:\/\/xinblog.ltd\/index.php?rest_route=\/wp\/v2\/posts\/5548"}],"collection":[{"href":"http:\/\/xinblog.ltd\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xinblog.ltd\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xinblog.ltd\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xinblog.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5548"}],"version-history":[{"count":1,"href":"http:\/\/xinblog.ltd\/index.php?rest_route=\/wp\/v2\/posts\/5548\/revisions"}],"predecessor-version":[{"id":5551,"href":"http:\/\/xinblog.ltd\/index.php?rest_route=\/wp\/v2\/posts\/5548\/revisions\/5551"}],"wp:attachment":[{"href":"http:\/\/xinblog.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinblog.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5548"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinblog.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}