{"id":55348,"date":"2025-08-13T21:14:46","date_gmt":"2025-08-13T13:14:46","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/55348.html"},"modified":"2025-08-13T21:14:46","modified_gmt":"2025-08-13T13:14:46","slug":"%e8%af%8d%e5%90%91%e9%87%8f%e8%bd%ac%e5%8c%96","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/55348.html","title":{"rendered":"\u8bcd\u5411\u91cf\u8f6c\u5316"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"-toc\" style=\"margin-left:0px\">\n<p id=\"%E8%AF%8D%E5%90%91%E9%87%8F%E8%BD%AC%E5%8C%96%EF%BC%9A%E8%AE%A9%E6%9C%BA%E5%99%A8%E8%AF%BB%E6%87%82%E4%BA%BA%E7%B1%BB%E8%AF%AD%E8%A8%80%E7%9A%84%E5%85%B3%E9%94%AE%E4%B8%80%E6%AD%A5-toc\" style=\"margin-left:0px\">\u8bcd\u5411\u91cf\u8f6c\u5316&#xff1a;\u8ba9\u673a\u5668\u8bfb\u61c2\u4eba\u7c7b\u8bed\u8a00\u7684\u5173\u952e\u4e00\u6b65<\/p>\n<p id=\"%E4%B8%80.%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E5%A4%84%E7%90%86(NLP)%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF-toc\" style=\"margin-left:0px\">\u4e00.\u81ea\u7136\u8bed\u8a00\u5904\u7406(NLP)\u5e94\u7528\u573a\u666f<\/p>\n<p id=\"%E4%BA%8C.%E4%BB%80%E4%B9%88%E6%98%AF%E8%AF%8D%E5%90%91%E9%87%8F-toc\" style=\"margin-left:0px\">\u4e8c.\u4ec0\u4e48\u662f\u8bcd\u5411\u91cf<\/p>\n<p id=\"%E4%B8%89.%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81%E8%AF%8D%E5%90%91%E9%87%8F-toc\" style=\"margin-left:0px\">\u4e09.\u4e3a\u4ec0\u4e48\u9700\u8981\u8bcd\u5411\u91cf<\/p>\n<p id=\"%E5%9B%9B.%E8%AF%8D%E5%90%91%E9%87%8F%E8%BD%AC%E5%8C%96-toc\" style=\"margin-left:0px\">\u56db.\u8bcd\u5411\u91cf\u8f6c\u5316<\/p>\n<p id=\"1.%E7%9B%AE%E7%9A%84-toc\" style=\"margin-left:40px\">1.\u76ee\u7684<\/p>\n<p id=\"2.%E6%96%B9%E6%B3%95-toc\" style=\"margin-left:40px\">2.\u65b9\u6cd5<\/p>\n<p id=\"%E4%BA%94.%E8%AF%8D%E5%90%91%E9%87%8F%E7%9A%84%E5%B1%80%E9%99%90%E6%80%A7%E5%92%8C%E5%8F%91%E5%B1%95-toc\" style=\"margin-left:0px\">\u4e94.\u8bcd\u5411\u91cf\u7684\u5c40\u9650\u6027\u548c\u53d1\u5c55<\/p>\n<p id=\"%E5%85%AD.%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:0px\">\u516d.\u603b\u7ed3<\/p>\n<p id=\"%E4%B8%83.%E4%BB%A3%E7%A0%81%E6%BC%94%E7%A4%BA%EF%BC%88%E5%9F%BA%E4%BA%8E%E7%BB%9F%E8%AE%A1%EF%BC%89-toc\" style=\"margin-left:0px\">\u4e03.\u4ee3\u7801\u6f14\u793a&#xff08;\u57fa\u4e8e\u7edf\u8ba1&#xff09;<\/p>\n<p id=\"1.%E5%B0%86%E4%B8%8B%E5%88%97%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84texts%E4%B8%AD%E7%9A%84%E5%86%85%E5%AE%B9%E8%BD%AC%E5%8C%96%E4%B8%BA%E8%AF%8D%E5%90%91%E9%87%8F-toc\" style=\"margin-left:40px\">1.\u5c06\u4e0b\u5217\u4ee3\u7801\u4e2d\u7684texts\u4e2d\u7684\u5185\u5bb9\u8f6c\u5316\u4e3a\u8bcd\u5411\u91cf<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"%E8%AF%8D%E5%90%91%E9%87%8F%E8%BD%AC%E5%8C%96%EF%BC%9A%E8%AE%A9%E6%9C%BA%E5%99%A8%E8%AF%BB%E6%87%82%E4%BA%BA%E7%B1%BB%E8%AF%AD%E8%A8%80%E7%9A%84%E5%85%B3%E9%94%AE%E4%B8%80%E6%AD%A5\">\u8bcd\u5411\u91cf\u8f6c\u5316&#xff1a;\u8ba9\u673a\u5668\u8bfb\u61c2\u4eba\u7c7b\u8bed\u8a00\u7684\u5173\u952e\u4e00\u6b65<\/h2>\n<p>\u6211\u4eec\u77e5\u9053TF-IDF\u53ef\u4ee5\u7528\u4e8e\u63d0\u53d6\u6587\u7ae0\u5173\u952e\u8bcd&#xff0c;\u4f46\u4ec5\u9002\u7528\u4e8e\u5173\u952e\u8bcd\u63d0\u53d6&#xff0c;\u65e0\u6cd5\u76f4\u63a5\u7528\u4e8e\u6587\u672c\u5206\u7c7b\u6216\u7406\u89e3\u53e5\u5b50\u542b\u4e49\u3002<\/p>\n<p>\u5728\u81ea\u7136\u8bed\u8a00\u5904\u7406&#xff08;NLP&#xff09;\u9886\u57df&#xff0c;\u8bcd\u5411\u91cf&#xff08;Word Embedding&#xff09;\u662f\u4e00\u9879\u9769\u547d\u6027\u7684\u6280\u672f&#xff0c;\u5b83\u89e3\u51b3\u4e86\u8ba1\u7b97\u673a\u96be\u4ee5\u7406\u89e3\u4eba\u7c7b\u8bed\u8a00\u7684\u6838\u5fc3\u95ee\u9898\u3002\u672c\u6587\u5c06\u6df1\u5165\u63a2\u8ba8\u8bcd\u5411\u91cf\u7684\u6982\u5ff5\u3001\u539f\u7406\u3001\u4e3b\u6d41\u7b97\u6cd5\u53ca\u5176\u5b9e\u8df5\u5e94\u7528&#xff0c;\u5e2e\u52a9\u4f60\u5168\u9762\u7406\u89e3\u8fd9\u4e00 NLP \u57fa\u7840\u6280\u672f\u3002<\/p>\n<h2 id=\"%E4%B8%80.%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E5%A4%84%E7%90%86(NLP)%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF\">\u4e00.\u81ea\u7136\u8bed\u8a00\u5904\u7406(NLP)\u5e94\u7528\u573a\u666f<\/h2>\n<ul>\n<li>\u6587\u672c\u5206\u7c7b&#xff1a;\u533a\u5206\u6587\u7ae0\u7c7b\u578b(\u5982\u65b0\u95fb&#xff0c;\u653f\u6cbb&#xff0c;\u8d22\u7ecf)<\/li>\n<li>\u60c5\u611f\u5206\u6790&#xff1a;\u5224\u65ad\u8bc4\u8bba\u7684\u6b63\u8d1f\u9762&#xff08;\u5982\u597d\u8bc4\u6216\u5dee\u8bc4&#xff09;<\/li>\n<li>\u6587\u672c\u5bf9\u8bdd&#xff1a;\u5b9e\u73b0\u95ee\u7b54\u4ea4\u4e92&#xff08;\u5927\u6a21\u578b\u652f\u6301&#xff09;<\/li>\n<li>\u7f51\u7edc\u5e73\u53f0\u8d23\u4efb&#xff1a;\u9700\u81ea\u52a8\u68c0\u6d4b\u5e76\u5c4f\u853d\u653b\u51fb\u6027\u8bc4\u8bba&#xff0c;\u9632\u6b62\u7f51\u7edc\u66b4\u529b<\/li>\n<\/ul>\n<h2 id=\"%E4%BA%8C.%E4%BB%80%E4%B9%88%E6%98%AF%E8%AF%8D%E5%90%91%E9%87%8F\" style=\"background-color:transparent\">\u4e8c.\u4ec0\u4e48\u662f\u8bcd\u5411\u91cf<\/h2>\n<p>\u8bcd\u5411\u91cf\u662f\u5c06\u81ea\u7136\u8bed\u8a00\u4e2d\u7684\u8bcd\u8bed\u8f6c\u6362\u4e3a\u6570\u503c\u5411\u91cf\u7684\u6280\u672f\u3002\u7b80\u5355\u6765\u8bf4&#xff0c;\u5c31\u662f\u7ed9\u6bcf\u4e2a\u8bcd\u5206\u914d\u4e00\u4e2a\u56fa\u5b9a\u957f\u5ea6\u7684\u6570\u5b57\u5217\u8868&#xff0c;\u4f7f\u5f97\u8fd9\u4e9b\u6570\u5b57\u80fd\u591f\u6355\u6349\u8bcd\u8bed\u7684\u8bed\u4e49\u4fe1\u606f\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;&#034;\u56fd\u738b&#034; \u53ef\u80fd\u88ab\u8868\u793a\u4e3a [0.2, 0.5, -0.1, 0.3, &#8230;]&#xff0c;\u800c &#034;\u5973\u738b&#034; \u7684\u5411\u91cf\u4f1a\u4e0e &#034;\u56fd\u738b&#034; \u7684\u5411\u91cf\u975e\u5e38\u76f8\u4f3c&#xff0c;\u56e0\u4e3a\u5b83\u4eec\u5728\u8bed\u4e49\u4e0a\u63a5\u8fd1\u3002<\/p>\n<h2 id=\"%E4%B8%89.%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81%E8%AF%8D%E5%90%91%E9%87%8F\">\u4e09.\u4e3a\u4ec0\u4e48\u9700\u8981\u8bcd\u5411\u91cf<\/h2>\n<p>\u5728\u8bcd\u5411\u91cf\u6280\u672f\u51fa\u73b0\u4e4b\u524d&#xff0c;\u8ba1\u7b97\u673a\u5904\u7406\u6587\u672c\u4e3b\u8981\u91c7\u7528\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f&#xff1a;<\/p>\n<li>\n<p>one-hot \u7f16\u7801&#xff1a;\u4e3a\u6bcf\u4e2a\u8bcd\u521b\u5efa\u4e00\u4e2a\u72ec\u70ed\u5411\u91cf&#xff0c;\u5411\u91cf\u957f\u5ea6\u7b49\u4e8e\u8bcd\u6c47\u8868\u5927\u5c0f&#xff0c;\u53ea\u6709\u5bf9\u5e94\u8bcd\u7684\u4f4d\u7f6e\u4e3a 1&#xff0c;\u5176\u4f59\u4e3a 0\u3002<\/p>\n<p> \u7f3a\u70b9&#xff1a;\u7ef4\u5ea6\u707e\u96be\u3001\u65e0\u6cd5\u8868\u793a\u8bed\u4e49\u5173\u7cfb\u3001\u5411\u91cf\u7a00\u758f<\/li>\n<li>\n<p>\u8bcd\u888b\u6a21\u578b&#xff08;Bag of Words&#xff09;&#xff1a;\u4ec5\u7edf\u8ba1\u8bcd\u7684\u51fa\u73b0\u9891\u7387&#xff0c;\u5ffd\u7565\u8bcd\u5e8f\u548c\u8bed\u4e49\u3002<\/p>\n<p> \u7f3a\u70b9&#xff1a;\u4e22\u5931\u4e0a\u4e0b\u6587\u4fe1\u606f\u3001\u65e0\u6cd5\u6355\u6349\u8bcd\u8bed\u95f4\u7684\u5173\u8054<\/li>\n<p>\u8bcd\u5411\u91cf\u5219\u5b8c\u7f8e\u89e3\u51b3\u4e86\u8fd9\u4e9b\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>\u4f4e\u7ef4\u5ea6\u8868\u793a&#xff0c;\u907f\u514d\u7ef4\u5ea6\u707e\u96be<\/li>\n<li>\u80fd\u591f\u6355\u6349\u8bcd\u8bed\u7684\u8bed\u4e49\u548c\u8bed\u6cd5\u7279\u5f81<\/li>\n<li>\u76f8\u4f3c\u7684\u8bcd\u5177\u6709\u76f8\u4f3c\u7684\u5411\u91cf\u8868\u793a<\/li>\n<li>\u652f\u6301\u5411\u91cf\u8fd0\u7b97&#xff0c;\u5982 &#034;\u56fd\u738b &#8211; \u7537\u4eba &#043; \u5973\u4eba\u2248\u5973\u738b&#034;<\/li>\n<\/ul>\n<h2 id=\"%E5%9B%9B.%E8%AF%8D%E5%90%91%E9%87%8F%E8%BD%AC%E5%8C%96\">\u56db.\u8bcd\u5411\u91cf\u8f6c\u5316<\/h2>\n<h3 id=\"1.%E7%9B%AE%E7%9A%84\">1.\u76ee\u7684<\/h3>\n<p>\u76ee\u7684\u662f\u5c06\u5355\u8bcd&#xff08;\u4e2d\/\u82f1&#xff09;\u8f6c\u5316\u4e3a\u6570\u503c\u5411\u91cf&#xff0c;\u4f7f\u6a21\u578b\u80fd\u591f\u5904\u7406\u6587\u672c\u6570\u636e<\/p>\n<h3 id=\"2.%E6%96%B9%E6%B3%95\">2.\u65b9\u6cd5<\/h3>\n<p>\u4e24\u79cd\u65b9\u6cd5&#xff1a;<\/p>\n<ul>\n<li>\u2460\u57fa\u4e8e\u7edf\u8ba1&#xff1a;\u7edf\u8ba1\u5355\u8bcd\u9891\u7387&#xff0c;\u6839\u636e\u6bcf\u4e2a\u7279\u5f81\u5355\u8bcd\u5728\u53e5\u5b50\u4e2d\u51fa\u73b0\u6b21\u6570\u8f6c\u5316\u8bcd\u5411\u91cf<\/li>\n<li>\u2461\u57fa\u4e8e\u795e\u7ecf\u7f51\u7edc&#xff1a;\u8bad\u7ec3\u5355\u8bcd\u7279\u5f81&#xff08;\u5982\u542b\u4e49\u3001\u5173\u8054\u6027&#xff09;&#xff0c;\u66f4\u5148\u8fdb\u4f46\u9700\u6df1\u5ea6\u5b66\u4e60\u57fa\u7840\u3002<\/li>\n<\/ul>\n<h2 id=\"%E4%BA%94.%E8%AF%8D%E5%90%91%E9%87%8F%E7%9A%84%E5%B1%80%E9%99%90%E6%80%A7%E5%92%8C%E5%8F%91%E5%B1%95\">\u4e94.\u8bcd\u5411\u91cf\u7684\u5c40\u9650\u6027\u548c\u53d1\u5c55<\/h2>\n<p>\u5c3d\u7ba1\u8bcd\u5411\u91cf\u5e26\u6765\u4e86\u5de8\u5927\u8fdb\u6b65&#xff0c;\u4f46\u4f20\u7edf\u8bcd\u5411\u91cf\u4ecd\u6709\u5c40\u9650\u6027&#xff1a;<\/p>\n<ul>\n<li>\u9759\u6001\u8bcd\u5411\u91cf&#xff1a;\u4e00\u4e2a\u8bcd\u53ea\u6709\u4e00\u4e2a\u5411\u91cf\u8868\u793a&#xff0c;\u65e0\u6cd5\u5904\u7406\u4e00\u8bcd\u591a\u4e49<\/li>\n<li>\u7f3a\u4e4f\u4e0a\u4e0b\u6587\u611f\u77e5&#xff1a;\u76f8\u540c\u7684\u8bcd\u5728\u4e0d\u540c\u8bed\u5883\u4e0b\u542b\u4e49\u4e0d\u540c&#xff0c;\u4f46\u5411\u91cf\u76f8\u540c<\/li>\n<\/ul>\n<p>\u4e3a\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898&#xff0c;\u8fd1\u5e74\u6765\u51fa\u73b0\u4e86\u57fa\u4e8e\u9884\u8bad\u7ec3\u8bed\u8a00\u6a21\u578b\u7684\u52a8\u6001\u8bcd\u5411\u91cf\u6280\u672f&#xff0c;\u5982 BERT\u3001GPT \u7b49\u3002\u8fd9\u4e9b\u6a21\u578b\u80fd\u591f\u6839\u636e\u4e0a\u4e0b\u6587\u751f\u6210\u4e0d\u540c\u7684\u8bcd\u5411\u91cf&#xff0c;\u66f4\u597d\u5730\u6355\u6349\u8bed\u8a00\u7684\u4e30\u5bcc\u6027\u548c\u6b67\u4e49\u6027\u3002<\/p>\n<h2 id=\"%E5%85%AD.%E6%80%BB%E7%BB%93\">\u516d.\u603b\u7ed3<\/h2>\n<p>\u8bcd\u5411\u91cf\u6280\u672f\u662f\u81ea\u7136\u8bed\u8a00\u5904\u7406\u9886\u57df\u7684\u91cd\u8981\u7a81\u7834&#xff0c;\u5b83\u4f7f\u5f97\u8ba1\u7b97\u673a\u80fd\u591f\u771f\u6b63 &#034;\u7406\u89e3&#034; \u8bcd\u8bed\u7684\u542b\u4e49&#xff0c;\u4e3a\u540e\u7eed\u7684\u590d\u6742 NLP \u4efb\u52a1\u5960\u5b9a\u4e86\u57fa\u7840\u3002\u4ece Word2Vec \u5230 BERT&#xff0c;\u8bcd\u5411\u91cf\u6280\u672f\u4e0d\u65ad\u53d1\u5c55&#xff0c;\u63a8\u52a8\u7740 NLP \u9886\u57df\u7684\u8fdb\u6b65\u3002<\/p>\n<p>\u65e0\u8bba\u662f\u4ece\u4e8b NLP \u7814\u7a76\u8fd8\u662f\u5e94\u7528\u5f00\u53d1&#xff0c;\u6df1\u5165\u7406\u89e3\u8bcd\u5411\u91cf\u7684\u539f\u7406\u548c\u5e94\u7528\u90fd\u662f\u975e\u5e38\u5fc5\u8981\u7684\u3002\u968f\u7740\u6280\u672f\u7684\u4e0d\u65ad\u53d1\u5c55&#xff0c;\u6211\u4eec\u6709\u7406\u7531\u76f8\u4fe1&#xff0c;\u673a\u5668\u5bf9\u4eba\u7c7b\u8bed\u8a00\u7684\u7406\u89e3\u4f1a\u8d8a\u6765\u8d8a\u6df1\u5165\u548c\u7cbe\u51c6\u3002<\/p>\n<h2 id=\"%E4%B8%83.%E4%BB%A3%E7%A0%81%E6%BC%94%E7%A4%BA%EF%BC%88%E5%9F%BA%E4%BA%8E%E7%BB%9F%E8%AE%A1%EF%BC%89\">\u4e03.\u4ee3\u7801\u6f14\u793a&#xff08;\u57fa\u4e8e\u7edf\u8ba1&#xff09;<\/h2>\n<h3 id=\"1.%E5%B0%86%E4%B8%8B%E5%88%97%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84texts%E4%B8%AD%E7%9A%84%E5%86%85%E5%AE%B9%E8%BD%AC%E5%8C%96%E4%B8%BA%E8%AF%8D%E5%90%91%E9%87%8F\">1.\u5c06\u4e0b\u5217\u4ee3\u7801\u4e2d\u7684texts\u4e2d\u7684\u5185\u5bb9\u8f6c\u5316\u4e3a\u8bcd\u5411\u91cf<\/h3>\n<p>\u5bfc\u5165\u76f8\u5173\u5e93<\/p>\n<p>from sklearn.feature_extraction.text import  CountVectorizer<br \/>\ntexts&#061;[&#039;dog cat fish&#039;,&#039;dog cat cat&#039;,&#039;fish bird&#039;,&#039;fish bir&#061;d&#039;]<\/p>\n<p>\u4f7f\u7528CountVectorizer\u7c7b\u5b9e\u73b0\u8bcd\u5411\u91cf\u8f6c\u5316&#xff1a;<\/p>\n<ul>\n<li>\u53c2\u6570max_features\u9650\u5236\u63d0\u53d6\u7684\u5355\u8bcd\u6570\u91cf\u3002<\/li>\n<li>\u53c2\u6570ngram_range\u63a7\u5236\u5355\u8bcd\u7ec4\u5408\u8303\u56f4&#xff08;\u5982(1,3)\u8868\u793a\u63d0\u53d61\u52303\u4e2a\u8fde\u7eed\u5355\u8bcd\u7684\u7ec4\u5408&#xff09;\u3002<\/li>\n<\/ul>\n<p>cv&#061;CountVectorizer(max_features&#061;6,ngram_range&#061;(1,2)) <\/p>\n<p>\u8bad\u7ec3\u51fa\u8bcd\u5e93\u5e76\u5c06\u6587\u672c\u5185\u5bb9\u8f6c\u5316\u4e3a\u8bcd\u5411\u91cffit_transform&#xff0c;<\/p>\n<p>cv_fit&#061;cv.fit_transform(texts)<br \/>\nprint(cv_fit)<\/p>\n<p>  (0, 3)1<br \/>\n  (0, 2)1<br \/>\n  (0, 5)1<br \/>\n  (0, 4)1<br \/>\n  (1, 3)1<br \/>\n  (1, 2)2<br \/>\n  (1, 4)1<br \/>\n  (2, 5)1<br \/>\n  (2, 1)1<br \/>\n  (3, 5)1<br \/>\n  (3, 0)1 <\/p>\n<p>\u6253\u5370\u6a21\u578b\u8bcd\u5e93<\/p>\n<p>print(cv.get_feature_names_out())<\/p>\n<p>[&#039;bir&#039; &#039;bird&#039; &#039;cat&#039; &#039;dog&#039; &#039;dog cat&#039; &#039;fish&#039;] <\/p>\n<p>\u5c06\u8bcd\u5411\u91cf\u8f6c\u5316\u4e3a\u8bcd\u9891\u77e9\u9635&#xff08;\u5982&#034;dog&#034;\u51fa\u73b01\u6b21\u3001&#034;cat&#034;\u51fa\u73b01\u6b21\u7b49&#xff09;\u3002<\/p>\n<p>\u884c\u540d\u662f\u7b2c\u51e0\u4e2a\u6587\u672c\u4f8b\u5982\u6211\u4eec\u4e0a\u9762\u67094\u4e2a\u6587\u672c\u5c31\u662f4\u884c<\/p>\n<p>\u5217\u540d\u662f\u8bcd\u5e93\u4e2d\u7684\u5355\u8bcd\u4f8b\u5982&#039;bir&#039; &#039;bird&#039; &#039;cat&#039; &#039;dog&#039; &#039;dog cat&#039; &#039;fish&#039;\u6709\u516d\u4e2a\u5c31\u6709\u516d\u5217<\/p>\n<p>\u6570\u7ec4\u4e2d\u7684\u6570\u5b57\u5c31\u662f\u8bcd\u5e93\u4e2d\u7684\u5355\u8bcd\u5728\u5bf9\u5e94\u7684\u6587\u672c\u4e2d\u51fa\u73b0\u7684\u6b21\u6570<\/p>\n<p>print(cv_fit.toarray())<\/p>\n<p>[[0 0 1 1 1 1]<br \/>\n [0 0 2 1 1 0]<br \/>\n [0 1 0 0 0 1]<br \/>\n [1 0 0 0 0 1]] <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb156\u6b21\u3002\u8bcd\u5411\u91cf\u662f\u5c06\u81ea\u7136\u8bed\u8a00\u4e2d\u7684\u8bcd\u8bed\u8f6c\u6362\u4e3a\u6570\u503c\u5411\u91cf\u7684\u6280\u672f\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u7ed9\u6bcf\u4e2a\u8bcd\u5206\u914d\u4e00\u4e2a\u56fa\u5b9a\u957f\u5ea6\u7684\u6570\u5b57\u5217\u8868\uff0c\u4f7f\u5f97\u8fd9\u4e9b\u6570\u5b57\u80fd\u591f\u6355\u6349\u8bcd\u8bed\u7684\u8bed\u4e49\u4fe1\u606f\u3002\u4f8b\u5982\uff0c&quot;\u56fd\u738b&quot; \u53ef\u80fd\u88ab\u8868\u793a\u4e3a [0.2, 0.5, -0.1, 0.3, &#8230;]\uff0c\u800c &quot;\u5973\u738b&quot; \u7684\u5411\u91cf\u4f1a\u4e0e &quot;\u56fd\u738b&quot; \u7684\u5411\u91cf\u975e\u5e38\u76f8\u4f3c\uff0c\u56e0\u4e3a\u5b83\u4eec\u5728\u8bed\u4e49\u4e0a\u63a5\u8fd1\u3002\u8bcd\u5411\u91cf\u6280\u672f\u662f\u81ea\u7136\u8bed\u8a00\u5904\u7406\u9886\u57df\u7684\u91cd\u8981\u7a81\u7834\uff0c\u5b83\u4f7f\u5f97\u8ba1\u7b97\u673a\u80fd\u591f\u771f\u6b63 &quot;\u7406\u89e3&quot; \u8bcd\u8bed\u7684\u542b\u4e49\uff0c\u4e3a\u540e\u7eed\u7684\u590d\u6742 NLP \u4efb\u52a1\u5960\u5b9a\u4e86\u57fa\u7840\u3002\u4ece Word2Vec \u5230 BERT\uff0c\u8bcd\u5411\u91cf\u6280\u672f\u4e0d\u65ad\u53d1\u5c55\uff0c\u63a8\u52a8\u7740 NLP \u9886\u57df\u7684\u8fdb\u6b65\u3002<\/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":[81,737,207,5691],"topic":[],"class_list":["post-55348","post","type-post","status-publish","format-standard","hentry","category-server","tag-python","tag-scikit-learn","tag-207","tag-5691"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8bcd\u5411\u91cf\u8f6c\u5316 - \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\/55348.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8bcd\u5411\u91cf\u8f6c\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb156\u6b21\u3002\u8bcd\u5411\u91cf\u662f\u5c06\u81ea\u7136\u8bed\u8a00\u4e2d\u7684\u8bcd\u8bed\u8f6c\u6362\u4e3a\u6570\u503c\u5411\u91cf\u7684\u6280\u672f\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u7ed9\u6bcf\u4e2a\u8bcd\u5206\u914d\u4e00\u4e2a\u56fa\u5b9a\u957f\u5ea6\u7684\u6570\u5b57\u5217\u8868\uff0c\u4f7f\u5f97\u8fd9\u4e9b\u6570\u5b57\u80fd\u591f\u6355\u6349\u8bcd\u8bed\u7684\u8bed\u4e49\u4fe1\u606f\u3002\u4f8b\u5982\uff0c&quot;\u56fd\u738b&quot; \u53ef\u80fd\u88ab\u8868\u793a\u4e3a [0.2, 0.5, -0.1, 0.3, ...]\uff0c\u800c &quot;\u5973\u738b&quot; \u7684\u5411\u91cf\u4f1a\u4e0e &quot;\u56fd\u738b&quot; \u7684\u5411\u91cf\u975e\u5e38\u76f8\u4f3c\uff0c\u56e0\u4e3a\u5b83\u4eec\u5728\u8bed\u4e49\u4e0a\u63a5\u8fd1\u3002\u8bcd\u5411\u91cf\u6280\u672f\u662f\u81ea\u7136\u8bed\u8a00\u5904\u7406\u9886\u57df\u7684\u91cd\u8981\u7a81\u7834\uff0c\u5b83\u4f7f\u5f97\u8ba1\u7b97\u673a\u80fd\u591f\u771f\u6b63 &quot;\u7406\u89e3&quot; \u8bcd\u8bed\u7684\u542b\u4e49\uff0c\u4e3a\u540e\u7eed\u7684\u590d\u6742 NLP \u4efb\u52a1\u5960\u5b9a\u4e86\u57fa\u7840\u3002\u4ece Word2Vec \u5230 BERT\uff0c\u8bcd\u5411\u91cf\u6280\u672f\u4e0d\u65ad\u53d1\u5c55\uff0c\u63a8\u52a8\u7740 NLP \u9886\u57df\u7684\u8fdb\u6b65\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/55348.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-13T13:14:46+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\/55348.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/55348.html\",\"name\":\"\u8bcd\u5411\u91cf\u8f6c\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-13T13:14:46+00:00\",\"dateModified\":\"2025-08-13T13:14:46+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/55348.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/55348.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/55348.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8bcd\u5411\u91cf\u8f6c\u5316\"}]},{\"@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":"\u8bcd\u5411\u91cf\u8f6c\u5316 - \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\/55348.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8bcd\u5411\u91cf\u8f6c\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb156\u6b21\u3002\u8bcd\u5411\u91cf\u662f\u5c06\u81ea\u7136\u8bed\u8a00\u4e2d\u7684\u8bcd\u8bed\u8f6c\u6362\u4e3a\u6570\u503c\u5411\u91cf\u7684\u6280\u672f\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u7ed9\u6bcf\u4e2a\u8bcd\u5206\u914d\u4e00\u4e2a\u56fa\u5b9a\u957f\u5ea6\u7684\u6570\u5b57\u5217\u8868\uff0c\u4f7f\u5f97\u8fd9\u4e9b\u6570\u5b57\u80fd\u591f\u6355\u6349\u8bcd\u8bed\u7684\u8bed\u4e49\u4fe1\u606f\u3002\u4f8b\u5982\uff0c&quot;\u56fd\u738b&quot; \u53ef\u80fd\u88ab\u8868\u793a\u4e3a [0.2, 0.5, -0.1, 0.3, ...]\uff0c\u800c &quot;\u5973\u738b&quot; \u7684\u5411\u91cf\u4f1a\u4e0e &quot;\u56fd\u738b&quot; \u7684\u5411\u91cf\u975e\u5e38\u76f8\u4f3c\uff0c\u56e0\u4e3a\u5b83\u4eec\u5728\u8bed\u4e49\u4e0a\u63a5\u8fd1\u3002\u8bcd\u5411\u91cf\u6280\u672f\u662f\u81ea\u7136\u8bed\u8a00\u5904\u7406\u9886\u57df\u7684\u91cd\u8981\u7a81\u7834\uff0c\u5b83\u4f7f\u5f97\u8ba1\u7b97\u673a\u80fd\u591f\u771f\u6b63 &quot;\u7406\u89e3&quot; \u8bcd\u8bed\u7684\u542b\u4e49\uff0c\u4e3a\u540e\u7eed\u7684\u590d\u6742 NLP \u4efb\u52a1\u5960\u5b9a\u4e86\u57fa\u7840\u3002\u4ece Word2Vec \u5230 BERT\uff0c\u8bcd\u5411\u91cf\u6280\u672f\u4e0d\u65ad\u53d1\u5c55\uff0c\u63a8\u52a8\u7740 NLP \u9886\u57df\u7684\u8fdb\u6b65\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/55348.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-13T13:14:46+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\/55348.html","url":"https:\/\/www.wsisp.com\/helps\/55348.html","name":"\u8bcd\u5411\u91cf\u8f6c\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-13T13:14:46+00:00","dateModified":"2025-08-13T13:14:46+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/55348.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/55348.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/55348.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8bcd\u5411\u91cf\u8f6c\u5316"}]},{"@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\/55348","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=55348"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/55348\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=55348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=55348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=55348"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=55348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}