{"id":1082141,"date":"2025-01-08T12:46:07","date_gmt":"2025-01-08T04:46:07","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1082141.html"},"modified":"2025-01-08T12:46:09","modified_gmt":"2025-01-08T04:46:09","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8python%e8%be%93%e5%87%ba%e5%85%b3%e9%94%ae%e8%af%8d-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1082141.html","title":{"rendered":"\u5982\u4f55\u4f7f\u7528python\u8f93\u51fa\u5173\u952e\u8bcd"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24183820\/c4a6fefc-88a1-4b5b-9f82-140141d19a24.webp\" alt=\"\u5982\u4f55\u4f7f\u7528python\u8f93\u51fa\u5173\u952e\u8bcd\" \/><\/p>\n<p><p> <strong>\u5982\u4f55\u4f7f\u7528Python\u8f93\u51fa\u5173\u952e\u8bcd<\/strong>\uff1a<strong>\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u63d0\u53d6\u5173\u952e\u8bcd\u3001\u5229\u7528NLTK\u5e93\u8fdb\u884c\u5173\u952e\u8bcd\u63d0\u53d6\u3001\u4f7f\u7528spaCy\u8fdb\u884c\u81ea\u7136\u8bed\u8a00\u5904\u7406\u3001\u5229\u7528TextRank\u7b97\u6cd5\u63d0\u53d6\u5173\u952e\u8bcd<\/strong>\u3002\u5728\u8fd9\u4e9b\u65b9\u6cd5\u4e2d\uff0c<strong>\u4f7f\u7528NLTK\u5e93\u8fdb\u884c\u5173\u952e\u8bcd\u63d0\u53d6<\/strong>\u662f\u4e00\u4e2a\u8f83\u4e3a\u5e38\u89c1\u4e14\u6613\u4e8e\u4e0a\u624b\u7684\u65b9\u6cd5\u3002NLTK\u5e93\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u8bed\u8a00\u5904\u7406\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u8f7b\u677e\u5730\u8fdb\u884c\u5206\u8bcd\u3001\u8bcd\u6027\u6807\u6ce8\u3001\u53bb\u9664\u505c\u7528\u8bcd\u7b49\u64cd\u4f5c\uff0c\u4ece\u800c\u63d0\u53d6\u51fa\u5173\u952e\u8bcd\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528NLTK\u5e93\u8fdb\u884c\u5173\u952e\u8bcd\u63d0\u53d6\u3002<\/p>\n<\/p>\n<p><p>NLTK\uff08Natural Language Toolkit\uff09\u662f\u4e00\u4e2a\u5f3a\u5927\u7684Python\u5e93\uff0c\u7528\u4e8e\u5904\u7406\u548c\u5206\u6790\u4eba\u7c7b\u8bed\u8a00\u6570\u636e\u3002\u5b83\u5305\u542b\u4e86\u5927\u91cf\u7684\u6587\u672c\u5904\u7406\u5e93\u548c\u6570\u636e\u96c6\uff0c\u9002\u7528\u4e8e\u6587\u672c\u6316\u6398\u3001\u81ea\u7136\u8bed\u8a00\u5904\u7406\u7b49\u4efb\u52a1\u3002\u901a\u8fc7NLTK\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u65b9\u4fbf\u5730\u5b9e\u73b0\u5173\u952e\u8bcd\u63d0\u53d6\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528NLTK\u5e93\u8fdb\u884c\u5173\u952e\u8bcd\u63d0\u53d6\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5b89\u88c5NLTK\u5e93<\/p>\n<p>\u5728\u5f00\u59cb\u4f7f\u7528NLTK\u5e93\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5b89\u88c5\u5b83\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install nltk<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u8fd8\u9700\u8981\u4e0b\u8f7d\u4e00\u4e9bNLTK\u6570\u636e\u5305\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import nltk<\/p>\n<p>nltk.download(&#39;punkt&#39;)<\/p>\n<p>nltk.download(&#39;stopwords&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u5bfc\u5165\u6240\u9700\u6a21\u5757<\/p>\n<p>\u5728\u8fdb\u884c\u5173\u952e\u8bcd\u63d0\u53d6\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5bfc\u5165\u76f8\u5173\u7684NLTK\u6a21\u5757\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<p>from nltk.probability import FreqDist<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u52a0\u8f7d\u6587\u672c\u6570\u636e<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6\u6587\u672c\u6570\u636e\uff0c\u6216\u8005\u76f4\u63a5\u4f7f\u7528\u5b57\u7b26\u4e32\u5f62\u5f0f\u7684\u6587\u672c\u6570\u636e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;&quot;&quot;Python is a high-level, interpreted, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation. Its language constructs and object-oriented approach <a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>m to help programmers write clear, logical code for small and large-scale projects.&quot;&quot;&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u6587\u672c\u9884\u5904\u7406<\/p>\n<p>\u5728\u63d0\u53d6\u5173\u952e\u8bcd\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5bf9\u6587\u672c\u8fdb\u884c\u9884\u5904\u7406\uff0c\u5305\u62ec\u5206\u8bcd\u3001\u53bb\u9664\u505c\u7528\u8bcd\u7b49\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5206\u8bcd<\/p>\n<p>words = word_tokenize(text)<\/p>\n<h2><strong>\u53bb\u9664\u505c\u7528\u8bcd<\/strong><\/h2>\n<p>stop_words = set(stopwords.words(&#39;english&#39;))<\/p>\n<p>filtered_words = [word for word in words if word.lower() not in stop_words]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u8ba1\u7b97\u8bcd\u9891<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97\u6bcf\u4e2a\u8bcd\u7684\u9891\u7387\uff0c\u4ee5\u4fbf\u627e\u51fa\u51fa\u73b0\u9891\u7387\u6700\u9ad8\u7684\u8bcd\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">freq_dist = FreqDist(filtered_words)<\/p>\n<h2><strong>\u8f93\u51fa\u6700\u5e38\u89c1\u7684\u5173\u952e\u8bcd<\/strong><\/h2>\n<p>keywords = freq_dist.most_common(10)<\/p>\n<p>print(keywords)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528NLTK\u5e93\u8f7b\u677e\u5730\u5b9e\u73b0\u5173\u952e\u8bcd\u63d0\u53d6\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5176\u4ed6\u51e0\u79cd\u5e38\u7528\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u63d0\u53d6\u5173\u952e\u8bcd<\/h3>\n<\/p>\n<p><p>\u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u4e00\u79cd\u5f3a\u5927\u7684\u6587\u672c\u5904\u7406\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u4e8e\u5339\u914d\u548c\u63d0\u53d6\u7279\u5b9a\u6a21\u5f0f\u7684\u6587\u672c\u3002\u901a\u8fc7\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u7279\u5b9a\u7684\u5173\u952e\u8bcd\u6a21\u5f0f\u8fdb\u884c\u63d0\u53d6\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u5b89\u88c5re\u6a21\u5757<\/strong><\/p>\n<p>Python\u7684\u6807\u51c6\u5e93\u4e2d\u5df2\u7ecf\u5305\u542b\u4e86re\u6a21\u5757\uff0c\u56e0\u6b64\u6211\u4eec\u4e0d\u9700\u8981\u989d\u5916\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><p><strong>2. \u5bfc\u5165re\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>3. \u5b9a\u4e49\u5173\u952e\u8bcd\u6a21\u5f0f<\/strong><\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a\u5173\u952e\u8bcd\u6a21\u5f0f\uff0c\u4ee5\u4fbf\u4ece\u6587\u672c\u4e2d\u63d0\u53d6\u51fa\u7b26\u5408\u8be5\u6a21\u5f0f\u7684\u5173\u952e\u8bcd\u3002\u4f8b\u5982\uff0c\u4e0b\u9762\u7684\u6a21\u5f0f\u5339\u914d\u4ee5\u5b57\u6bcd\u5f00\u5934\u7684\u5355\u8bcd\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">pattern = r&#39;\\b[a-zA-Z]+\\b&#39;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>4. \u63d0\u53d6\u5173\u952e\u8bcd<\/strong><\/p>\n<p>\u4f7f\u7528re.findall\u51fd\u6570\uff0c\u6839\u636e\u5b9a\u4e49\u7684\u6a21\u5f0f\u4ece\u6587\u672c\u4e2d\u63d0\u53d6\u5173\u952e\u8bcd\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">keywords = re.findall(pattern, text)<\/p>\n<p>print(keywords)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u5229\u7528NLTK\u5e93\u8fdb\u884c\u5173\u952e\u8bcd\u63d0\u53d6<\/h3>\n<\/p>\n<p><p>NLTK\u5e93\u662f\u81ea\u7136\u8bed\u8a00\u5904\u7406\u9886\u57df\u4e2d\u975e\u5e38\u6d41\u884c\u7684\u5de5\u5177\u5305\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6587\u672c\u5904\u7406\u529f\u80fd\u3002\u6211\u4eec\u53ef\u4ee5\u5229\u7528NLTK\u5e93\u4e2d\u7684\u5206\u8bcd\u3001\u8bcd\u6027\u6807\u6ce8\u548c\u505c\u7528\u8bcd\u8fc7\u6ee4\u7b49\u529f\u80fd\uff0c\u6765\u63d0\u53d6\u5173\u952e\u8bcd\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u5b89\u88c5NLTK\u5e93<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install nltk<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>2. \u5bfc\u5165\u6240\u9700\u6a21\u5757<\/strong><\/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<p>from nltk.probability import FreqDist<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>3. \u4e0b\u8f7dNLTK\u6570\u636e\u5305<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">nltk.download(&#39;punkt&#39;)<\/p>\n<p>nltk.download(&#39;stopwords&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>4. \u6587\u672c\u9884\u5904\u7406<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5206\u8bcd<\/p>\n<p>words = word_tokenize(text)<\/p>\n<h2><strong>\u53bb\u9664\u505c\u7528\u8bcd<\/strong><\/h2>\n<p>stop_words = set(stopwords.words(&#39;english&#39;))<\/p>\n<p>filtered_words = [word for word in words if word.lower() not in stop_words]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>5. \u8ba1\u7b97\u8bcd\u9891<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">freq_dist = FreqDist(filtered_words)<\/p>\n<p>keywords = freq_dist.most_common(10)<\/p>\n<p>print(keywords)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528spaCy\u8fdb\u884c\u81ea\u7136\u8bed\u8a00\u5904\u7406<\/h3>\n<\/p>\n<p><p>spaCy\u662f\u53e6\u4e00\u4e2a\u5f3a\u5927\u7684\u81ea\u7136\u8bed\u8a00\u5904\u7406\u5e93\uff0c\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6587\u672c\u5904\u7406\u548c\u5206\u6790\u529f\u80fd\u3002\u6211\u4eec\u53ef\u4ee5\u5229\u7528spaCy\u8fdb\u884c\u5206\u8bcd\u3001\u8bcd\u6027\u6807\u6ce8\u3001\u547d\u540d\u5b9e\u4f53\u8bc6\u522b\u7b49\u64cd\u4f5c\uff0c\u6765\u63d0\u53d6\u5173\u952e\u8bcd\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u5b89\u88c5spaCy<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install spacy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>2. \u4e0b\u8f7dspaCy\u6a21\u578b<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m spacy download en_core_web_sm<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>3. \u5bfc\u5165spaCy\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import spacy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>4. \u52a0\u8f7dspaCy\u6a21\u578b<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">nlp = spacy.load(&#39;en_core_web_sm&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>5. \u6587\u672c\u5904\u7406<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">doc = nlp(text)<\/p>\n<h2><strong>\u63d0\u53d6\u540d\u8bcd\u3001\u52a8\u8bcd\u7b49\u5173\u952e\u8bcd<\/strong><\/h2>\n<p>keywords = [token.text for token in doc if token.pos_ in [&#39;NOUN&#39;, &#39;VERB&#39;]]<\/p>\n<p>print(keywords)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u5229\u7528TextRank\u7b97\u6cd5\u63d0\u53d6\u5173\u952e\u8bcd<\/h3>\n<\/p>\n<p><p>TextRank\u662f\u4e00\u79cd\u57fa\u4e8e\u56fe\u7684\u6392\u5e8f\u7b97\u6cd5\uff0c\u5e38\u7528\u4e8e\u5173\u952e\u8bcd\u63d0\u53d6\u548c\u6587\u672c\u6458\u8981\u751f\u6210\u3002\u6211\u4eec\u53ef\u4ee5\u5229\u7528TextRank\u7b97\u6cd5\u63d0\u53d6\u6587\u672c\u4e2d\u7684\u5173\u952e\u8bcd\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u5b89\u88c5Gensim\u5e93<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install gensim<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>2. \u5bfc\u5165Gensim\u6a21\u5757<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from gensim.summarization import keywords<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>3. \u63d0\u53d6\u5173\u952e\u8bcd<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">extracted_keywords = keywords(text, words=10, lemmatize=True)<\/p>\n<p>print(extracted_keywords)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Python\u8f7b\u677e\u5730\u5b9e\u73b0\u5173\u952e\u8bcd\u63d0\u53d6\u3002\u4e0d\u540c\u7684\u65b9\u6cd5\u9002\u7528\u4e8e\u4e0d\u540c\u7684\u573a\u666f\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u3002\u65e0\u8bba\u662f\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u3001NLTK\u3001spaCy\uff0c\u8fd8\u662fTextRank\u7b97\u6cd5\uff0c\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u52bf\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u9ad8\u6548\u5730\u63d0\u53d6\u51fa\u6587\u672c\u4e2d\u7684\u5173\u952e\u8bcd\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u63d0\u53d6\u6587\u672c\u4e2d\u7684\u5173\u952e\u8bcd\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u5e93\u6765\u63d0\u53d6\u6587\u672c\u4e2d\u7684\u5173\u952e\u8bcd\uff0c\u4f8b\u5982NLTK\u3001spaCy\u548cGensim\u3002\u9996\u5148\uff0c\u4f60\u9700\u8981\u5b89\u88c5\u76f8\u5173\u5e93\uff0c\u7136\u540e\u901a\u8fc7\u5206\u8bcd\u3001\u53bb\u9664\u505c\u7528\u8bcd\u548c\u8ba1\u7b97\u8bcd\u9891\u7b49\u65b9\u6cd5\u6765\u8bc6\u522b\u5173\u952e\u8bcd\u3002\u4f7f\u7528TF-IDF\uff08\u8bcd\u9891-\u9006\u6587\u6863\u9891\u7387\uff09\u65b9\u6cd5\u4e5f\u662f\u4e00\u79cd\u6709\u6548\u7684\u9009\u62e9\uff0c\u5b83\u80fd\u591f\u8861\u91cf\u4e00\u4e2a\u8bcd\u5728\u6587\u6863\u4e2d\u7684\u91cd\u8981\u6027\u3002\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u63d0\u53d6\u51fa\u6587\u672c\u7684\u5173\u952e\u8bcd\u3002<\/p>\n<p><strong>\u6709\u54ea\u4e9b\u5e38\u7528\u7684Python\u5e93\u53ef\u4ee5\u5e2e\u52a9\u8f93\u51fa\u5173\u952e\u8bcd\uff1f<\/strong><br \/>Python\u4e2d\u6709\u8bb8\u591a\u5f3a\u5927\u7684\u5e93\u53ef\u4ee5\u7528\u6765\u63d0\u53d6\u5173\u952e\u8bcd\u3002\u5e38\u89c1\u7684\u5e93\u5305\u62ecNLTK\uff08\u81ea\u7136\u8bed\u8a00\u5de5\u5177\u5305\uff09\u3001spaCy\uff08\u9ad8\u7ea7\u81ea\u7136\u8bed\u8a00\u5904\u7406\u5e93\uff09\u548cGensim\uff08\u7528\u4e8e\u4e3b\u9898\u5efa\u6a21\u548c\u6587\u6863\u76f8\u4f3c\u5ea6\u7684\u5e93\uff09\u3002\u8fd9\u4e9b\u5e93\u90fd\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u8fdb\u884c\u6587\u672c\u5206\u6790\u548c\u5173\u952e\u8bcd\u63d0\u53d6\u3002\u6839\u636e\u9879\u76ee\u7684\u9700\u8981\u9009\u62e9\u5408\u9002\u7684\u5e93\uff0c\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u6548\u7387\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f18\u5316\u5173\u952e\u8bcd\u63d0\u53d6\u7684\u6548\u679c\uff1f<\/strong><br \/>\u4e3a\u4e86\u63d0\u9ad8\u5173\u952e\u8bcd\u63d0\u53d6\u7684\u6548\u679c\uff0c\u53ef\u4ee5\u8003\u8651\u591a\u4e2a\u56e0\u7d20\u3002\u9996\u5148\uff0c\u786e\u4fdd\u4f7f\u7528\u7684\u6587\u672c\u6570\u636e\u662f\u9ad8\u8d28\u91cf\u7684\uff0c\u907f\u514d\u566a\u97f3\u548c\u4e0d\u76f8\u5173\u7684\u4fe1\u606f\u3002\u5176\u6b21\uff0c\u7ed3\u5408\u591a\u79cd\u65b9\u6cd5\uff0c\u4f8b\u5982TF-IDF\u548c\u8bcd\u5411\u91cf\u6a21\u578b\uff0c\u80fd\u591f\u66f4\u5168\u9762\u5730\u6355\u6349\u5173\u952e\u8bcd\u3002\u6700\u540e\uff0c\u5b9a\u671f\u8c03\u6574\u548c\u66f4\u65b0\u7b97\u6cd5\u53c2\u6570\uff0c\u6839\u636e\u5b9e\u9645\u5e94\u7528\u7684\u53cd\u9988\u8fdb\u884c\u4f18\u5316\uff0c\u4ee5\u4fdd\u8bc1\u63d0\u53d6\u7ed3\u679c\u7684\u51c6\u786e\u6027\u548c\u76f8\u5173\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5982\u4f55\u4f7f\u7528Python\u8f93\u51fa\u5173\u952e\u8bcd\uff1a\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u63d0\u53d6\u5173\u952e\u8bcd\u3001\u5229\u7528NLTK\u5e93\u8fdb\u884c\u5173\u952e\u8bcd\u63d0\u53d6\u3001\u4f7f\u7528spaCy\u8fdb\u884c\u81ea\u7136 [&hellip;]","protected":false},"author":3,"featured_media":1082153,"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\/1082141"}],"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=1082141"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1082141\/revisions"}],"predecessor-version":[{"id":1082154,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1082141\/revisions\/1082154"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1082153"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1082141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1082141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1082141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}