{"id":1147422,"date":"2025-01-13T16:24:44","date_gmt":"2025-01-13T08:24:44","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1147422.html"},"modified":"2025-01-13T16:24:46","modified_gmt":"2025-01-13T08:24:46","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8python%e8%af%ad%e8%a8%80%e4%b8%ad","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1147422.html","title":{"rendered":"\u5982\u4f55\u4f7f\u7528python\u8bed\u8a00\u4e2d"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25165547\/63a9cee4-a9d5-4db0-a335-53c407f00cee.webp\" alt=\"\u5982\u4f55\u4f7f\u7528python\u8bed\u8a00\u4e2d\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u8bed\u8a00\u7684\u6838\u5fc3\u8981\u70b9\u5305\u62ec\uff1a\u7b80\u6d01\u7684\u8bed\u6cd5\u3001\u5e7f\u6cdb\u7684\u5e93\u652f\u6301\u3001\u5f3a\u5927\u7684\u793e\u533a\u652f\u6301\u3001\u826f\u597d\u7684\u8de8\u5e73\u53f0\u80fd\u529b\u3001\u4e30\u5bcc\u7684\u6570\u636e\u5904\u7406\u80fd\u529b\u3002<\/strong>\u5176\u4e2d\uff0c\u5e7f\u6cdb\u7684\u5e93\u652f\u6301\u662fPython\u8bed\u8a00\u4e00\u4e2a\u975e\u5e38\u7a81\u51fa\u7684\u4f18\u52bf\u3002Python\u62e5\u6709\u4e30\u5bcc\u7684\u6807\u51c6\u5e93\u548c\u7b2c\u4e09\u65b9\u5e93\uff0c\u53ef\u4ee5\u6ee1\u8db3\u5404\u79cd\u4e0d\u540c\u9886\u57df\u7684\u9700\u6c42\uff0c\u4ece\u6570\u636e\u5206\u6790\u3001<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u5230Web\u5f00\u53d1\u3001\u7f51\u7edc\u722c\u866b\u7b49\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u5c55\u5f00\u5e7f\u6cdb\u7684\u5e93\u652f\u6301\u8fd9\u4e00\u70b9\u3002<\/p>\n<\/p>\n<p><p>Python\u7684\u5e7f\u6cdb\u5e93\u652f\u6301\u4f7f\u5f97\u5b83\u5728\u5404\u79cd\u5e94\u7528\u573a\u666f\u4e2d\u90fd\u80fd\u5f97\u5fc3\u5e94\u624b\u3002\u6bd4\u5982\uff0cNumPy\u548cPandas\u662f\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u7684\u5229\u5668\uff0cTensorFlow\u548cPyTorch\u662f\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\u9886\u57df\u7684\u91cd\u8981\u5de5\u5177\uff0cDjango\u548cFlask\u662fWeb\u5f00\u53d1\u7684\u5e38\u7528\u6846\u67b6\uff0cScrapy\u662f\u722c\u866b\u5f00\u53d1\u7684\u5f3a\u5927\u5de5\u5177\u3002\u6b64\u5916\uff0cPython\u8fd8\u63d0\u4f9b\u4e86\u8bb8\u591a\u5176\u4ed6\u9886\u57df\u7684\u5e93\uff0c\u5982\u56fe\u50cf\u5904\u7406\u7684PIL\u3001\u79d1\u5b66\u8ba1\u7b97\u7684SciPy\u3001\u6e38\u620f\u5f00\u53d1\u7684Pygame\u7b49\u3002\u8fd9\u4e9b\u5e93\u7684\u5b58\u5728\u5927\u5927\u7b80\u5316\u4e86\u5f00\u53d1\u5de5\u4f5c\uff0c\u63d0\u9ad8\u4e86\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001Python\u8bed\u8a00\u7684\u7b80\u6d01\u8bed\u6cd5<\/h3>\n<\/p>\n<p><p>Python\u4ee5\u5176\u7b80\u6d01\u660e\u4e86\u7684\u8bed\u6cd5\u800c\u95fb\u540d\uff0c\u8fd9\u4f7f\u5f97\u5b83\u6210\u4e3a\u521d\u5b66\u8005\u548c\u4e13\u4e1a\u5f00\u53d1\u8005\u7684\u9996\u9009\u7f16\u7a0b\u8bed\u8a00\u3002Python\u7684\u4ee3\u7801\u901a\u5e38\u6bd4\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\u66f4\u77ed\u3001\u66f4\u5bb9\u6613\u7406\u89e3\uff0c\u8fd9\u6709\u52a9\u4e8e\u51cf\u5c11\u4ee3\u7801\u7684\u7ef4\u62a4\u6210\u672c\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u4ee3\u7801\u7b80\u6d01\u6613\u8bfb<\/h4>\n<\/p>\n<p><p>Python\u5f3a\u8c03\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\uff0c\u4f7f\u7528\u7f29\u8fdb\u6765\u8868\u793a\u4ee3\u7801\u5757\u800c\u4e0d\u662f\u4f7f\u7528\u5927\u62ec\u53f7\uff0c\u8fd9\u4f7f\u5f97\u4ee3\u7801\u770b\u8d77\u6765\u66f4\u6574\u6d01\u3002\u4f8b\u5982\uff0c\u4e0b\u9762\u662f\u4e00\u4e2aPython\u7684if\u8bed\u53e5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">if x &gt; 0:<\/p>\n<p>    print(&quot;x is positive&quot;)<\/p>\n<p>else:<\/p>\n<p>    print(&quot;x is non-positive&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e0e\u5176\u4ed6\u8bed\u8a00\u76f8\u6bd4\uff0cPython\u7684\u4ee3\u7801\u66f4\u5bb9\u6613\u9605\u8bfb\u548c\u7406\u89e3\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u52a8\u6001\u7c7b\u578b\u7cfb\u7edf<\/h4>\n<\/p>\n<p><p>Python\u662f\u52a8\u6001\u7c7b\u578b\u8bed\u8a00\uff0c\u8fd9\u610f\u5473\u7740\u53d8\u91cf\u7684\u7c7b\u578b\u662f\u5728\u8fd0\u884c\u65f6\u786e\u5b9a\u7684\uff0c\u800c\u4e0d\u662f\u5728\u7f16\u8bd1\u65f6\u3002\u8fd9\u4f7f\u5f97Python\u4ee3\u7801\u66f4\u52a0\u7075\u6d3b\uff0c\u5f00\u53d1\u8005\u4e0d\u9700\u8981\u663e\u5f0f\u58f0\u660e\u53d8\u91cf\u7684\u7c7b\u578b\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">x = 10<\/p>\n<p>x = &quot;Hello&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u8fd9\u79cd\u7c7b\u578b\u7684\u53d8\u5316\u662f\u5141\u8bb8\u7684\uff0c\u8fd9\u5728\u9759\u6001\u7c7b\u578b\u8bed\u8a00\u4e2d\u662f\u4e0d\u53ef\u80fd\u7684\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u5e7f\u6cdb\u7684\u5e93\u652f\u6301<\/h3>\n<\/p>\n<p><p>Python\u62e5\u6709\u4e30\u5bcc\u7684\u6807\u51c6\u5e93\u548c\u7b2c\u4e09\u65b9\u5e93\uff0c\u8fd9\u4f7f\u5f97\u5b83\u5728\u5404\u79cd\u5e94\u7528\u573a\u666f\u4e2d\u90fd\u80fd\u5f97\u5fc3\u5e94\u624b\u3002\u65e0\u8bba\u662f\u6570\u636e\u5206\u6790\u3001\u673a\u5668\u5b66\u4e60\u3001Web\u5f00\u53d1\u8fd8\u662f\u7f51\u7edc\u722c\u866b\uff0cPython\u90fd\u6709\u76f8\u5e94\u7684\u5e93\u652f\u6301\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u6570\u636e\u5206\u6790\u4e0e\u5904\u7406<\/h4>\n<\/p>\n<p><p>Python\u5728\u6570\u636e\u5206\u6790\u4e0e\u5904\u7406\u9886\u57df\u6709\u7740\u5e7f\u6cdb\u7684\u5e94\u7528\uff0c\u4e3b\u8981\u4f9d\u8d56\u4e8e\u4ee5\u4e0b\u51e0\u4e2a\u5e93\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>NumPy<\/strong>\uff1a\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\uff0c\u652f\u6301\u591a\u7ef4\u6570\u7ec4\u548c\u77e9\u9635\u8fd0\u7b97\uff0c\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u6570\u5b66\u51fd\u6570\u3002<\/li>\n<li><strong>Pandas<\/strong>\uff1a\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c\u6570\u636e\u5904\u7406\uff0c\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784\u548c\u6570\u636e\u5206\u6790\u5de5\u5177\u3002<\/li>\n<li><strong>Matplotlib<\/strong>\uff1a\u7528\u4e8e\u6570\u636e\u53ef\u89c6\u5316\uff0c\u80fd\u591f\u751f\u6210\u5404\u79cd\u7c7b\u578b\u7684\u56fe\u8868\u3002<\/li>\n<\/ul>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528Pandas\u53ef\u4ee5\u8f7b\u677e\u5730\u8bfb\u53d6\u548c\u5904\u7406CSV\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>df = pd.read_csv(&#39;data.csv&#39;)<\/p>\n<p>print(df.head())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u673a\u5668\u5b66\u4e60\u4e0e\u6df1\u5ea6\u5b66\u4e60<\/h4>\n<\/p>\n<p><p>Python\u5728\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\u9886\u57df\u4e5f\u6709\u7740\u5e7f\u6cdb\u7684\u5e94\u7528\uff0c\u4e3b\u8981\u4f9d\u8d56\u4e8e\u4ee5\u4e0b\u51e0\u4e2a\u5e93\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>Scikit-learn<\/strong>\uff1a\u7528\u4e8e\u673a\u5668\u5b66\u4e60\uff0c\u63d0\u4f9b\u4e86\u5404\u79cd\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u548c\u5de5\u5177\u3002<\/li>\n<li><strong>TensorFlow<\/strong>\uff1a\u7528\u4e8e\u6df1\u5ea6\u5b66\u4e60\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7075\u6d3b\u7684\u8ba1\u7b97\u56fe\u6846\u67b6\u3002<\/li>\n<li><strong>PyTorch<\/strong>\uff1a\u4e5f\u662f\u7528\u4e8e\u6df1\u5ea6\u5b66\u4e60\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u52a8\u6001\u8ba1\u7b97\u56fe\u6846\u67b6\u3002<\/li>\n<\/ul>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528Scikit-learn\u53ef\u4ee5\u8f7b\u677e\u5730\u6784\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u673a\u5668\u5b66\u4e60\u6a21\u578b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.datasets import load_iris<\/p>\n<p>from sklearn.model_selection import tr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n_test_split<\/p>\n<p>from sklearn.ensemble import RandomForestClassifier<\/p>\n<p>from sklearn.metrics import accuracy_score<\/p>\n<h2><strong>\u52a0\u8f7d\u6570\u636e\u96c6<\/strong><\/h2>\n<p>data = load_iris()<\/p>\n<p>X = data.data<\/p>\n<p>y = data.target<\/p>\n<h2><strong>\u5206\u5272\u6570\u636e\u96c6<\/strong><\/h2>\n<p>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)<\/p>\n<h2><strong>\u8bad\u7ec3\u6a21\u578b<\/strong><\/h2>\n<p>model = RandomForestClassifier()<\/p>\n<p>model.fit(X_train, y_train)<\/p>\n<h2><strong>\u9884\u6d4b<\/strong><\/h2>\n<p>y_pred = model.predict(X_test)<\/p>\n<h2><strong>\u8bc4\u4f30\u6a21\u578b<\/strong><\/h2>\n<p>print(&quot;Accuracy:&quot;, accuracy_score(y_test, y_pred))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u5f3a\u5927\u7684\u793e\u533a\u652f\u6301<\/h3>\n<\/p>\n<p><p>Python\u62e5\u6709\u4e00\u4e2a\u5f3a\u5927\u7684\u793e\u533a\uff0c\u8fd9\u610f\u5473\u7740\u4f60\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u627e\u5230\u5e2e\u52a9\u3001\u8d44\u6e90\u548c\u5de5\u5177\u3002\u65e0\u8bba\u662f\u5b98\u65b9\u6587\u6863\u3001\u7b2c\u4e09\u65b9\u6559\u7a0b\u8fd8\u662f\u793e\u533a\u8bba\u575b\uff0cPython\u7684\u8d44\u6e90\u90fd\u975e\u5e38\u4e30\u5bcc\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b98\u65b9\u6587\u6863\u548c\u6559\u7a0b<\/h4>\n<\/p>\n<p><p>Python\u7684\u5b98\u65b9\u6587\u6863\u975e\u5e38\u8be6\u7ec6\uff0c\u6db5\u76d6\u4e86\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u7684\u5404\u79cd\u4e3b\u9898\u3002\u6b64\u5916\uff0cPython\u5b98\u65b9\u7f51\u7ad9\u8fd8\u63d0\u4f9b\u4e86\u8bb8\u591a\u6559\u7a0b\uff0c\u5e2e\u52a9\u521d\u5b66\u8005\u5feb\u901f\u4e0a\u624b\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u793e\u533a\u8bba\u575b\u548c\u95ee\u7b54\u7f51\u7ad9<\/h4>\n<\/p>\n<p><p>Python\u793e\u533a\u6d3b\u8dc3\u5728\u5404\u79cd\u8bba\u575b\u548c\u95ee\u7b54\u7f51\u7ad9\u4e0a\uff0c\u6bd4\u5982Stack Overflow\u3001Reddit\u548cPython\u5b98\u65b9\u8bba\u575b\u3002\u4f60\u53ef\u4ee5\u5728\u8fd9\u4e9b\u5e73\u53f0\u4e0a\u63d0\u51fa\u95ee\u9898\uff0c\u5bfb\u6c42\u5e2e\u52a9\uff0c\u6216\u8005\u5206\u4eab\u4f60\u7684\u7ecf\u9a8c\u548c\u89c1\u89e3\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u826f\u597d\u7684\u8de8\u5e73\u53f0\u80fd\u529b<\/h3>\n<\/p>\n<p><p>Python\u662f\u8de8\u5e73\u53f0\u7684\uff0c\u8fd9\u610f\u5473\u7740\u4f60\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884cPython\u4ee3\u7801\u3002\u65e0\u8bba\u662fWindows\u3001Linux\u8fd8\u662fMacOS\uff0cPython\u90fd\u80fd\u65e0\u7f1d\u8fd0\u884c\u3002\u8fd9\u4f7f\u5f97Python\u5728\u5f00\u53d1\u8de8\u5e73\u53f0\u5e94\u7528\u65f6\u5177\u6709\u5f88\u5927\u7684\u4f18\u52bf\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u8de8\u5e73\u53f0\u5f00\u53d1<\/h4>\n<\/p>\n<p><p>Python\u7684\u8de8\u5e73\u53f0\u80fd\u529b\u4f7f\u5f97\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fdb\u884c\u5f00\u53d1\u548c\u6d4b\u8bd5\uff0c\u800c\u4e0d\u9700\u8981\u62c5\u5fc3\u4ee3\u7801\u7684\u517c\u5bb9\u6027\u95ee\u9898\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u5728Windows\u4e0a\u7f16\u5199Python\u4ee3\u7801\uff0c\u7136\u540e\u5728Linux\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u5b83\uff0c\u800c\u4e0d\u9700\u8981\u505a\u4efb\u4f55\u4fee\u6539\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u5e7f\u6cdb\u7684\u90e8\u7f72\u9009\u9879<\/h4>\n<\/p>\n<p><p>Python\u7684\u8de8\u5e73\u53f0\u80fd\u529b\u8fd8\u63d0\u4f9b\u4e86\u5e7f\u6cdb\u7684\u90e8\u7f72\u9009\u9879\u3002\u65e0\u8bba\u662f\u672c\u5730\u90e8\u7f72\u3001\u4e91\u90e8\u7f72\u8fd8\u662f\u5bb9\u5668\u5316\u90e8\u7f72\uff0cPython\u90fd\u80fd\u5f88\u597d\u5730\u652f\u6301\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528Docker\u5c06Python\u5e94\u7528\u6253\u5305\u6210\u5bb9\u5668\uff0c\u65b9\u4fbf\u5730\u90e8\u7f72\u5230\u5404\u79cd\u73af\u5883\u4e2d\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u4e30\u5bcc\u7684\u6570\u636e\u5904\u7406\u80fd\u529b<\/h3>\n<\/p>\n<p><p>Python\u5728\u6570\u636e\u5904\u7406\u65b9\u9762\u6709\u7740\u4e30\u5bcc\u7684\u529f\u80fd\u548c\u5e93\u652f\u6301\uff0c\u80fd\u591f\u9ad8\u6548\u5730\u5904\u7406\u5404\u79cd\u7c7b\u578b\u7684\u6570\u636e\u3002\u65e0\u8bba\u662f\u7ed3\u6784\u5316\u6570\u636e\u3001\u975e\u7ed3\u6784\u5316\u6570\u636e\u8fd8\u662f\u5927\u6570\u636e\uff0cPython\u90fd\u6709\u76f8\u5e94\u7684\u5de5\u5177\u548c\u5e93\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5904\u7406\u7ed3\u6784\u5316\u6570\u636e<\/h4>\n<\/p>\n<p><p>Python\u7684Pandas\u5e93\u662f\u5904\u7406\u7ed3\u6784\u5316\u6570\u636e\u7684\u5229\u5668\uff0c\u5b83\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784\u548c\u6570\u636e\u64cd\u4f5c\u5de5\u5177\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528Pandas\u8f7b\u677e\u5730\u8bfb\u53d6\u3001\u5904\u7406\u548c\u5206\u6790\u7ed3\u6784\u5316\u6570\u636e\uff0c\u4f8b\u5982CSV\u6587\u4ef6\u3001Excel\u6587\u4ef6\u548cSQL\u6570\u636e\u5e93\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528Pandas\u8bfb\u53d6\u548c\u5904\u7406CSV\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u8bfb\u53d6CSV\u6587\u4ef6<\/strong><\/h2>\n<p>df = pd.read_csv(&#39;data.csv&#39;)<\/p>\n<h2><strong>\u6570\u636e\u5904\u7406<\/strong><\/h2>\n<p>df[&#39;new_column&#39;] = df[&#39;old_column&#39;] * 2<\/p>\n<h2><strong>\u6570\u636e\u5206\u6790<\/strong><\/h2>\n<p>print(df.describe())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u5904\u7406\u975e\u7ed3\u6784\u5316\u6570\u636e<\/h4>\n<\/p>\n<p><p>Python\u4e5f\u80fd\u591f\u9ad8\u6548\u5730\u5904\u7406\u975e\u7ed3\u6784\u5316\u6570\u636e\uff0c\u6bd4\u5982\u6587\u672c\u6570\u636e\u548c\u56fe\u50cf\u6570\u636e\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528NLP\u5e93\uff08\u5982NLTK\u548cspaCy\uff09\u6765\u5904\u7406\u6587\u672c\u6570\u636e\uff0c\u4f7f\u7528\u56fe\u50cf\u5904\u7406\u5e93\uff08\u5982PIL\u548cOpenCV\uff09\u6765\u5904\u7406\u56fe\u50cf\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528NLTK\u5904\u7406\u6587\u672c\u6570\u636e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import nltk<\/p>\n<p>from nltk.corpus import stopwords<\/p>\n<p>from nltk.tokenize import word_tokenize<\/p>\n<h2><strong>\u4e0b\u8f7d\u505c\u6b62\u8bcd<\/strong><\/h2>\n<p>nltk.download(&#39;stopwords&#39;)<\/p>\n<p>nltk.download(&#39;punkt&#39;)<\/p>\n<h2><strong>\u6587\u672c\u5904\u7406<\/strong><\/h2>\n<p>text = &quot;This is a sample text for processing with NLTK.&quot;<\/p>\n<p>tokens = word_tokenize(text)<\/p>\n<p>filtered_tokens = [word for word in tokens if word.lower() not in stopwords.words(&#39;english&#39;)]<\/p>\n<p>print(filtered_tokens)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001Python\u7684\u5e94\u7528\u573a\u666f<\/h3>\n<\/p>\n<p><p>Python\u56e0\u5176\u591a\u529f\u80fd\u6027\u548c\u5e7f\u6cdb\u7684\u5e93\u652f\u6301\uff0c\u88ab\u5e7f\u6cdb\u5e94\u7528\u4e8e\u4e0d\u540c\u7684\u9886\u57df\u3002\u4ee5\u4e0b\u662fPython\u5728\u51e0\u4e2a\u4e3b\u8981\u5e94\u7528\u573a\u666f\u4e2d\u7684\u5177\u4f53\u8868\u73b0\u3002<\/p>\n<\/p>\n<p><h4>1\u3001Web\u5f00\u53d1<\/h4>\n<\/p>\n<p><p>Python\u5728Web\u5f00\u53d1\u4e2d\u626e\u6f14\u7740\u91cd\u8981\u89d2\u8272\uff0c\u4e3b\u8981\u4f7f\u7528\u7684\u6846\u67b6\u6709Django\u548cFlask\u3002<\/p>\n<\/p>\n<ul>\n<li><strong>Django<\/strong>\uff1a\u4e00\u4e2a\u9ad8\u5c42\u6b21\u7684Python Web\u6846\u67b6\uff0c\u9f13\u52b1\u5feb\u901f\u5f00\u53d1\u548c\u5e72\u51c0\u3001\u5b9e\u7528\u7684\u8bbe\u8ba1\u3002Django\u63d0\u4f9b\u4e86\u8bb8\u591a\u5f00\u7bb1\u5373\u7528\u7684\u529f\u80fd\uff0c\u5982\u8eab\u4efd\u9a8c\u8bc1\u3001\u6570\u636e\u5e93\u7ba1\u7406\u3001\u6a21\u677f\u5f15\u64ce\u7b49\u3002<\/li>\n<li><strong>Flask<\/strong>\uff1a\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684Web\u6846\u67b6\uff0c\u63d0\u4f9b\u4e86\u7075\u6d3b\u6027\u548c\u53ef\u6269\u5c55\u6027\u3002Flask\u9002\u5408\u9700\u8981\u5b9a\u5236\u5316\u529f\u80fd\u7684\u9879\u76ee\u3002<\/li>\n<\/ul>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528Flask\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Web\u5e94\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from flask import Flask<\/p>\n<p>app = Flask(__name__)<\/p>\n<p>@app.route(&#39;\/&#39;)<\/p>\n<p>def hello():<\/p>\n<p>    return &quot;Hello, World!&quot;<\/p>\n<p>if __name__ == &#39;__main__&#39;:<\/p>\n<p>    app.run(debug=True)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6570\u636e\u79d1\u5b66\u4e0e\u673a\u5668\u5b66\u4e60<\/h4>\n<\/p>\n<p><p>Python\u662f\u6570\u636e\u79d1\u5b66\u548c\u673a\u5668\u5b66\u4e60\u9886\u57df\u7684\u9996\u9009\u8bed\u8a00\u3002\u9664\u4e86\u524d\u9762\u63d0\u5230\u7684NumPy\u3001Pandas\u3001Scikit-learn\u3001TensorFlow\u548cPyTorch\u5916\uff0c\u8fd8\u6709\u8bb8\u591a\u5176\u4ed6\u5de5\u5177\u548c\u5e93\uff0c\u5982Keras\u3001XGBoost\u3001LightGBM\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528Keras\u6784\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from keras.models import Sequential<\/p>\n<p>from keras.layers import Dense<\/p>\n<h2><strong>\u6784\u5efa\u6a21\u578b<\/strong><\/h2>\n<p>model = Sequential()<\/p>\n<p>model.add(Dense(64, activation=&#39;relu&#39;, input_dim=20))<\/p>\n<p>model.add(Dense(1, activation=&#39;sigmoid&#39;))<\/p>\n<h2><strong>\u7f16\u8bd1\u6a21\u578b<\/strong><\/h2>\n<p>model.compile(optimizer=&#39;adam&#39;, loss=&#39;binary_crossentropy&#39;, metrics=[&#39;accuracy&#39;])<\/p>\n<h2><strong>\u8bad\u7ec3\u6a21\u578b<\/strong><\/h2>\n<p>model.fit(X_train, y_train, epochs=10, batch_size=32)<\/p>\n<h2><strong>\u8bc4\u4f30\u6a21\u578b<\/strong><\/h2>\n<p>loss, accuracy = model.evaluate(X_test, y_test)<\/p>\n<p>print(&quot;Loss:&quot;, loss)<\/p>\n<p>print(&quot;Accuracy:&quot;, accuracy)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001Python\u7684\u8fdb\u9636\u529f\u80fd<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u57fa\u672c\u7684\u529f\u80fd\uff0cPython\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u8fdb\u9636\u529f\u80fd\uff0c\u4f7f\u5f97\u5f00\u53d1\u8005\u53ef\u4ee5\u66f4\u52a0\u9ad8\u6548\u5730\u8fdb\u884c\u5f00\u53d1\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u88c5\u9970\u5668<\/h4>\n<\/p>\n<p><p>\u88c5\u9970\u5668\u662fPython\u4e2d\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u7528\u6765\u4fee\u6539\u51fd\u6570\u6216\u7c7b\u7684\u884c\u4e3a\uff0c\u800c\u4e0d\u6539\u53d8\u5b83\u4eec\u7684\u5b9a\u4e49\u3002\u88c5\u9970\u5668\u901a\u5e38\u7528\u4e8e\u65e5\u5fd7\u8bb0\u5f55\u3001\u6743\u9650\u9a8c\u8bc1\u3001\u6027\u80fd\u8ba1\u65f6\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4e00\u4e2a\u7b80\u5355\u7684\u88c5\u9970\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def my_decorator(func):<\/p>\n<p>    def wrapper():<\/p>\n<p>        print(&quot;Something is happening before the function is called.&quot;)<\/p>\n<p>        func()<\/p>\n<p>        print(&quot;Something is happening after the function is called.&quot;)<\/p>\n<p>    return wrapper<\/p>\n<p>@my_decorator<\/p>\n<p>def say_hello():<\/p>\n<p>    print(&quot;Hello!&quot;)<\/p>\n<p>say_hello()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u751f\u6210\u5668<\/h4>\n<\/p>\n<p><p>\u751f\u6210\u5668\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u8fed\u4ee3\u5668\uff0c\u4f7f\u7528<code>yield<\/code>\u5173\u952e\u5b57\u8fd4\u56de\u503c\u3002\u751f\u6210\u5668\u5728\u5904\u7406\u5927\u6570\u636e\u96c6\u6216\u6d41\u6570\u636e\u65f6\u975e\u5e38\u6709\u7528\uff0c\u56e0\u4e3a\u5b83\u4eec\u4e0d\u4f1a\u4e00\u6b21\u6027\u5c06\u6240\u6709\u6570\u636e\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d\uff0c\u800c\u662f\u6309\u9700\u751f\u6210\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4e00\u4e2a\u7b80\u5355\u7684\u751f\u6210\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def my_generator(n):<\/p>\n<p>    for i in range(n):<\/p>\n<p>        yield i<\/p>\n<p>for value in my_generator(5):<\/p>\n<p>    print(value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001Python\u7684\u6027\u80fd\u4f18\u5316<\/h3>\n<\/p>\n<p><p>\u867d\u7136Python\u4ee5\u5176\u7b80\u6d01\u548c\u6613\u7528\u6027\u8457\u79f0\uff0c\u4f46\u5b83\u7684\u6027\u80fd\u6709\u65f6\u53ef\u80fd\u4e0d\u5982\u5176\u4ed6\u7f16\u8bd1\u578b\u8bed\u8a00\u3002\u4e3a\u4e86\u63d0\u9ad8Python\u7a0b\u5e8f\u7684\u6027\u80fd\uff0c\u6709\u51e0\u79cd\u5e38\u7528\u7684\u4f18\u5316\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u4f7f\u7528\u5408\u9002\u7684\u6570\u636e\u7ed3\u6784<\/h4>\n<\/p>\n<p><p>\u9009\u62e9\u5408\u9002\u7684\u6570\u636e\u7ed3\u6784\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6027\u80fd\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\u5217\u8868\uff08List\uff09\u8fdb\u884c\u67e5\u627e\u64cd\u4f5c\u65f6\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u662fO(n)\uff0c\u800c\u4f7f\u7528\u96c6\u5408\uff08Set\uff09\u6216\u5b57\u5178\uff08Dict\uff09\u8fdb\u884c\u67e5\u627e\u64cd\u4f5c\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u662fO(1)\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u591a\u7ebf\u7a0b\u548c\u591a\u8fdb\u7a0b<\/h4>\n<\/p>\n<p><p>Python\u7684<code>threading<\/code>\u6a21\u5757\u5141\u8bb8\u4f60\u4f7f\u7528\u591a\u7ebf\u7a0b\u8fdb\u884c\u5e76\u53d1\u7f16\u7a0b\uff0c\u4f46\u7531\u4e8e\u5168\u5c40\u89e3\u91ca\u5668\u9501\uff08GIL\uff09\u7684\u5b58\u5728\uff0c\u591a\u7ebf\u7a0b\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\u53ef\u80fd\u5e76\u4e0d\u80fd\u5e26\u6765\u6027\u80fd\u63d0\u5347\u3002\u4e3a\u4e86\u5145\u5206\u5229\u7528\u591a\u6838CPU\uff0c\u53ef\u4ee5\u4f7f\u7528<code>multiprocessing<\/code>\u6a21\u5757\u8fdb\u884c\u591a\u8fdb\u7a0b\u7f16\u7a0b\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528\u591a\u8fdb\u7a0b\u8fdb\u884c\u5e76\u884c\u8ba1\u7b97\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import multiprocessing<\/p>\n<p>def worker(num):<\/p>\n<p>    print(f&#39;Worker: {num}&#39;)<\/p>\n<p>if __name__ == &#39;__main__&#39;:<\/p>\n<p>    processes = []<\/p>\n<p>    for i in range(5):<\/p>\n<p>        p = multiprocessing.Process(target=worker, args=(i,))<\/p>\n<p>        processes.append(p)<\/p>\n<p>        p.start()<\/p>\n<p>    for p in processes:<\/p>\n<p>        p.join()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e5d\u3001Python\u7684\u672a\u6765\u53d1\u5c55<\/h3>\n<\/p>\n<p><p>Python\u5728\u8fc7\u53bb\u51e0\u5e74\u4e2d\u5feb\u901f\u53d1\u5c55\uff0c\u5e76\u4e14\u5176\u53d7\u6b22\u8fce\u7a0b\u5ea6\u4ecd\u5728\u4e0d\u65ad\u4e0a\u5347\u3002\u968f\u7740\u66f4\u591a\u7684\u5f00\u53d1\u8005\u548c\u516c\u53f8\u91c7\u7528Python\uff0c\u8fd9\u95e8\u8bed\u8a00\u7684\u751f\u6001\u7cfb\u7edf\u5c06\u7ee7\u7eed\u6269\u5c55\uff0c\u66f4\u591a\u7684\u5e93\u548c\u5de5\u5177\u5c06\u88ab\u5f00\u53d1\u51fa\u6765\u3002<\/p>\n<\/p>\n<p><h4>1\u3001<a href=\"https:\/\/docs.pingcode.com\/tag\/AI\" target=\"_blank\">\u4eba\u5de5\u667a\u80fd<\/a>\u4e0e\u673a\u5668\u5b66\u4e60<\/h4>\n<\/p>\n<p><p>\u968f\u7740\u4eba\u5de5\u667a\u80fd\u548c\u673a\u5668\u5b66\u4e60\u7684\u5feb\u901f\u53d1\u5c55\uff0cPython\u4f5c\u4e3a\u8fd9\u4e9b\u9886\u57df\u7684\u4e3b\u8981\u7f16\u7a0b\u8bed\u8a00\uff0c\u5c06\u7ee7\u7eed\u4fdd\u6301\u5176\u4f18\u52bf\u3002\u65b0\u7684\u673a\u5668\u5b66\u4e60\u6846\u67b6\u548c\u5de5\u5177\u5c06\u4e0d\u65ad\u6d8c\u73b0\uff0c\u8fdb\u4e00\u6b65\u63a8\u52a8Python\u7684\u53d1\u5c55\u3002<\/p>\n<\/p>\n<p><h4>2\u3001Web\u5f00\u53d1\u4e0e\u81ea\u52a8\u5316<\/h4>\n<\/p>\n<p><p>Python\u5728Web\u5f00\u53d1\u548c\u81ea\u52a8\u5316\u9886\u57df\u7684\u5e94\u7528\u4e5f\u5728\u4e0d\u65ad\u589e\u52a0\u3002\u65b0\u7684Web\u6846\u67b6\u548c\u81ea\u52a8\u5316\u5de5\u5177\u5c06\u4f7f\u5f97Python\u5728\u8fd9\u4e9b\u9886\u57df\u7684\u5e94\u7528\u66f4\u52a0\u5e7f\u6cdb\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3\u6765\u8bf4\uff0cPython\u662f\u4e00\u95e8\u529f\u80fd\u5f3a\u5927\u3001\u7b80\u6d01\u6613\u7528\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u5177\u6709\u5e7f\u6cdb\u7684\u5e93\u652f\u6301\u3001\u5f3a\u5927\u7684\u793e\u533a\u652f\u6301\u548c\u826f\u597d\u7684\u8de8\u5e73\u53f0\u80fd\u529b\uff0c\u80fd\u591f\u9ad8\u6548\u5730\u5904\u7406\u5404\u79cd\u7c7b\u578b\u7684\u6570\u636e\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u8fd8\u662f\u4e13\u4e1a\u5f00\u53d1\u8005\uff0c\u90fd\u80fd\u4ecePython\u4e2d\u53d7\u76ca\u3002\u672a\u6765\uff0c\u968f\u7740\u6280\u672f\u7684\u4e0d\u65ad\u8fdb\u6b65\uff0cPython\u5c06\u7ee7\u7eed\u5728\u5404\u4e2a\u9886\u57df\u53d1\u6325\u91cd\u8981\u4f5c\u7528\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5f00\u59cb\u5b66\u4e60Python\u7f16\u7a0b\u8bed\u8a00\uff1f<\/strong><br \/>\u5b66\u4e60Python\u7f16\u7a0b\u8bed\u8a00\u7684\u6700\u4f73\u65b9\u6cd5\u662f\u901a\u8fc7\u5728\u7ebf\u8bfe\u7a0b\u3001\u4e66\u7c4d\u548c\u5b9e\u8df5\u9879\u76ee\u3002\u8bb8\u591a\u7f51\u7ad9\u63d0\u4f9b\u514d\u8d39\u7684\u8d44\u6e90\uff0c\u5982Codecademy\u3001Coursera\u548cedX\uff0c\u9002\u5408\u521d\u5b66\u8005\u5165\u95e8\u3002\u6b64\u5916\uff0c\u9605\u8bfb\u300aPython\u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5\u300b\u7b49\u4e66\u7c4d\u53ef\u4ee5\u5e2e\u52a9\u52a0\u6df1\u7406\u89e3\u3002\u52a8\u624b\u5b9e\u8df5\uff0c\u901a\u8fc7\u5b8c\u6210\u5c0f\u9879\u76ee\u6216\u53c2\u52a0\u7f16\u7a0b\u6311\u6218\u6765\u5de9\u56fa\u6240\u5b66\u77e5\u8bc6\u4e5f\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n<p><strong>Python\u9002\u5408\u54ea\u4e9b\u7c7b\u578b\u7684\u9879\u76ee\uff1f<\/strong><br \/>Python\u662f\u4e00\u79cd\u901a\u7528\u7f16\u7a0b\u8bed\u8a00\uff0c\u9002\u5408\u591a\u79cd\u7c7b\u578b\u7684\u9879\u76ee\uff0c\u5305\u62ec\u7f51\u9875\u5f00\u53d1\u3001\u6570\u636e\u5206\u6790\u3001\u673a\u5668\u5b66\u4e60\u3001\u81ea\u52a8\u5316\u811a\u672c\u548c\u6e38\u620f\u5f00\u53d1\u7b49\u3002\u5176\u4e30\u5bcc\u7684\u5e93\u548c\u6846\u67b6\uff08\u5982Django\u3001Flask\u3001Pandas\u548cTensorFlow\uff09\u4f7f\u5f97Python\u5728\u8fd9\u4e9b\u9886\u57df\u8868\u73b0\u51fa\u8272\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u8fd8\u662f\u4e13\u4e1a\u5f00\u53d1\u4eba\u5458\uff0c\u90fd\u80fd\u627e\u5230\u9002\u5408\u81ea\u5df1\u7684\u9879\u76ee\u65b9\u5411\u3002<\/p>\n<p><strong>\u5982\u4f55\u89e3\u51b3Python\u7f16\u7a0b\u4e2d\u7684\u5e38\u89c1\u9519\u8bef\uff1f<\/strong><br \/>\u5728Python\u7f16\u7a0b\u4e2d\uff0c\u5e38\u89c1\u9519\u8bef\u5305\u62ec\u8bed\u6cd5\u9519\u8bef\u3001\u7c7b\u578b\u9519\u8bef\u548c\u7d22\u5f15\u9519\u8bef\u7b49\u3002\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u7684\u6709\u6548\u65b9\u6cd5\u662f\u4ed4\u7ec6\u9605\u8bfb\u9519\u8bef\u63d0\u793a\u4fe1\u606f\uff0c\u7406\u89e3\u9519\u8bef\u7684\u6765\u6e90\u3002\u5229\u7528\u8c03\u8bd5\u5de5\u5177\uff08\u5982PDB\uff09\u548cIDE\u7684\u8c03\u8bd5\u529f\u80fd\uff0c\u53ef\u4ee5\u9010\u6b65\u6267\u884c\u4ee3\u7801\uff0c\u627e\u5230\u95ee\u9898\u6240\u5728\u3002\u6b64\u5916\uff0c\u67e5\u9605\u6587\u6863\u548c\u793e\u533a\uff08\u5982Stack Overflow\uff09\u4e5f\u80fd\u83b7\u53d6\u89e3\u51b3\u65b9\u6848\u548c\u5efa\u8bae\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u8bed\u8a00\u7684\u6838\u5fc3\u8981\u70b9\u5305\u62ec\uff1a\u7b80\u6d01\u7684\u8bed\u6cd5\u3001\u5e7f\u6cdb\u7684\u5e93\u652f\u6301\u3001\u5f3a\u5927\u7684\u793e\u533a\u652f\u6301\u3001\u826f\u597d\u7684\u8de8\u5e73\u53f0\u80fd\u529b\u3001\u4e30\u5bcc\u7684\u6570\u636e\u5904\u7406 [&hellip;]","protected":false},"author":3,"featured_media":1147430,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1147422"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1147422"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1147422\/revisions"}],"predecessor-version":[{"id":1147434,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1147422\/revisions\/1147434"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1147430"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1147422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1147422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1147422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}