{"id":1182096,"date":"2025-01-15T18:59:14","date_gmt":"2025-01-15T10:59:14","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1182096.html"},"modified":"2025-01-15T18:59:16","modified_gmt":"2025-01-15T10:59:16","slug":"%e5%a6%82%e4%bd%95%e6%8a%bd%e5%8f%96%e5%85%b3%e9%94%ae%e5%ad%97python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1182096.html","title":{"rendered":"\u5982\u4f55\u62bd\u53d6\u5173\u952e\u5b57python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25130216\/68a3c7b8-0f92-461a-bd2d-4811bc3688cd.webp\" alt=\"\u5982\u4f55\u62bd\u53d6\u5173\u952e\u5b57python\" \/><\/p>\n<p><p> <strong>\u5982\u4f55\u62bd\u53d6\u5173\u952e\u5b57python\uff1a\u4f7f\u7528TF-IDF\u7b97\u6cd5\u3001\u4f7f\u7528TextRank\u7b97\u6cd5\u3001\u4f7f\u7528\u5206\u8bcd\u5de5\u5177\u3001\u4f7f\u7528\u4e3b\u9898\u6a21\u578b\u3001\u4f7f\u7528<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a><\/strong><\/p>\n<\/p>\n<p><p>\u5728\u672c\u6587\u7684\u5f00\u5934\uff0c\u6211\u4eec\u5c06\u76f4\u63a5\u56de\u7b54\u6807\u9898\u6240\u63d0\u95ee\u9898\u3002\u5173\u952e\u5b57\u62bd\u53d6\u5728\u6587\u672c\u5206\u6790\u4e2d\u662f\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u6b65\u9aa4\uff0cPython\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\u3002<strong>\u4e3b\u8981\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528TF-IDF\u7b97\u6cd5\u3001\u4f7f\u7528TextRank\u7b97\u6cd5\u3001\u4f7f\u7528\u5206\u8bcd\u5de5\u5177\u3001\u4f7f\u7528\u4e3b\u9898\u6a21\u578b\u3001\u4f7f\u7528\u673a\u5668\u5b66\u4e60<\/strong>\u3002\u5176\u4e2d\uff0c<strong>\u4f7f\u7528TF-IDF\u7b97\u6cd5<\/strong>\u662f\u4e00\u79cd\u5e38\u89c1\u4e14\u6709\u6548\u7684\u5173\u952e\u5b57\u62bd\u53d6\u65b9\u6cd5\u3002TF-IDF\u7b97\u6cd5\u901a\u8fc7\u8ba1\u7b97\u8bcd\u9891\u548c\u9006\u6587\u6863\u9891\u7387\uff0c\u8861\u91cf\u4e00\u4e2a\u8bcd\u5728\u6587\u6863\u4e2d\u7684\u91cd\u8981\u6027\u3002\u5177\u4f53\u6765\u8bf4\uff0cTF-IDF\u503c\u8d8a\u9ad8\uff0c\u8868\u793a\u8be5\u8bcd\u5728\u6587\u6863\u4e2d\u8d8a\u91cd\u8981\u3002\u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u5b9e\u73b0\u8fd9\u4e9b\u5173\u952e\u5b57\u62bd\u53d6\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<h2><strong>\u4e00\u3001\u4f7f\u7528TF-IDF\u7b97\u6cd5<\/strong><\/h2>\n<p><p>TF-IDF\uff08Term Frequency-Inverse Document Frequency\uff09\u662f\u4e00\u79cd\u5e38\u7528\u7684\u6587\u672c\u5206\u6790\u6280\u672f\uff0c\u7528\u4e8e\u8861\u91cf\u4e00\u4e2a\u8bcd\u5728\u6587\u6863\u4e2d\u7684\u91cd\u8981\u6027\u3002\u5b83\u7ed3\u5408\u4e86\u8bcd\u9891\uff08TF\uff09\u548c\u9006\u6587\u6863\u9891\u7387\uff08IDF\uff09\u4e24\u4e2a\u6307\u6807\uff0c\u6765\u8bc4\u4ef7\u4e00\u4e2a\u8bcd\u5728\u6587\u6863\u96c6\u4e2d\u7684\u4ee3\u8868\u6027\u3002TF-IDF\u7b97\u6cd5\u7684\u516c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><p>[ \\text{TF-IDF}(t,d) = \\text{TF}(t,d) \\times \\text{IDF}(t) ]<\/p>\n<\/p>\n<p><p>\u5176\u4e2d\uff1a<\/p>\n<\/p>\n<ul>\n<li>(\\text{TF}(t,d)) \u662f\u8bcd (t) \u5728\u6587\u6863 (d) \u4e2d\u51fa\u73b0\u7684\u6b21\u6570\u3002<\/li>\n<li>(\\text{IDF}(t)) \u662f\u8bcd (t) \u5728\u6587\u6863\u96c6\u4e2d\u7684\u9006\u6587\u6863\u9891\u7387\uff0c\u8ba1\u7b97\u516c\u5f0f\u4e3a\uff1a[ \\text{IDF}(t) = \\log \\left( \\frac{N}{1 + \\text{DF}(t)} \\right) ]\uff0c\u5176\u4e2d (N) \u662f\u6587\u6863\u603b\u6570\uff0c(\\text{DF}(t)) \u662f\u5305\u542b\u8bcd (t) \u7684\u6587\u6863\u6570\u91cf\u3002<\/li>\n<\/ul>\n<p><h2>1.1\u3001\u5bfc\u5165\u5fc5\u8981\u7684\u5e93<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.feature_extraction.text import TfidfVectorizer<\/p>\n<p>import pandas as pd<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>1.2\u3001\u51c6\u5907\u6587\u672c\u6570\u636e<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">documents = [<\/p>\n<p>    &quot;Python is a high-level programming language.&quot;,<\/p>\n<p>    &quot;Machine learning and data science are applications of Python.&quot;,<\/p>\n<p>    &quot;Python is popular for web development.&quot;,<\/p>\n<p>    &quot;Data analysis and machine learning are key applications of Python.&quot;<\/p>\n<p>]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>1.3\u3001\u8ba1\u7b97TF-IDF\u503c<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">vectorizer = TfidfVectorizer()<\/p>\n<p>tfidf_matrix = vectorizer.fit_transform(documents)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>1.4\u3001\u63d0\u53d6\u5173\u952e\u5b57<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">feature_names = vectorizer.get_feature_names_out()<\/p>\n<p>for doc in range(len(documents)):<\/p>\n<p>    df = pd.DataFrame(tfidf_matrix[doc].T.todense(), index=feature_names, columns=[&quot;TF-IDF&quot;])<\/p>\n<p>    df = df.sort_values(by=[&quot;TF-IDF&quot;], ascending=False)<\/p>\n<p>    print(f&quot;Document {doc+1} top keywords:\\n&quot;, df.head(5))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<h2><strong>\u4e8c\u3001\u4f7f\u7528TextRank\u7b97\u6cd5<\/strong><\/h2>\n<p><p>TextRank\u662f\u4e00\u79cd\u57fa\u4e8e\u56fe\u7684\u6392\u5e8f\u7b97\u6cd5\uff0c\u7528\u4e8e\u62bd\u53d6\u6587\u672c\u4e2d\u7684\u91cd\u8981\u4fe1\u606f\u3002\u5b83\u7c7b\u4f3c\u4e8ePageRank\u7b97\u6cd5\uff0c\u6700\u521d\u7528\u4e8e\u7f51\u9875\u6392\u540d\u3002TextRank\u901a\u8fc7\u6784\u5efa\u8bcd\u8bed\u4e4b\u95f4\u7684\u5173\u7cfb\u56fe\uff0c\u5229\u7528\u56fe\u7684\u7ed3\u6784\u6765\u786e\u5b9a\u6bcf\u4e2a\u8bcd\u7684\u91cd\u8981\u6027\u3002<\/p>\n<\/p>\n<p><h2>2.1\u3001\u5bfc\u5165\u5fc5\u8981\u7684\u5e93<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">import jieba.analyse<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>2.2\u3001\u51c6\u5907\u6587\u672c\u6570\u636e<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Python is a high-level programming language. Machine learning and data science are applications of Python. Python is popular for web development. Data analysis and machine learning are key applications of Python.&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>2.3\u3001\u4f7f\u7528TextRank\u7b97\u6cd5\u62bd\u53d6\u5173\u952e\u5b57<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">keywords = jieba.analyse.textrank(text, topK=5, withWeight=True)<\/p>\n<p>print(&quot;Top keywords using TextRank:\\n&quot;, keywords)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<h2><strong>\u4e09\u3001\u4f7f\u7528\u5206\u8bcd\u5de5\u5177<\/strong><\/h2>\n<p><p>\u5206\u8bcd\u662f\u6587\u672c\u5904\u7406\u4e2d\u7684\u57fa\u7840\u6b65\u9aa4\uff0c\u901a\u8fc7\u5c06\u6587\u672c\u5207\u5206\u6210\u4e00\u4e2a\u4e2a\u7684\u8bcd\u8bed\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u8fdb\u884c\u540e\u7eed\u7684\u6587\u672c\u5206\u6790\u3002\u5728Python\u4e2d\uff0c\u6709\u8bb8\u591a\u5206\u8bcd\u5de5\u5177\u53ef\u4f9b\u4f7f\u7528\uff0c\u5982Jieba\u3001NLTK\u3001SpaCy\u7b49\u3002<\/p>\n<\/p>\n<p><h2>3.1\u3001\u4f7f\u7528Jieba\u5206\u8bcd<\/h2>\n<\/p>\n<p><h3>3.1.1\u3001\u5bfc\u5165\u5fc5\u8981\u7684\u5e93<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">import jieba<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3.1.2\u3001\u51c6\u5907\u6587\u672c\u6570\u636e<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Python is a high-level programming language. Machine learning and data science are applications of Python.&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3.1.3\u3001\u8fdb\u884c\u5206\u8bcd<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">words = jieba.cut(text)<\/p>\n<p>print(&quot;Words using Jieba:\\n&quot;, &quot;\/&quot;.join(words))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>3.2\u3001\u4f7f\u7528NLTK\u5206\u8bcd<\/h2>\n<\/p>\n<p><h3>3.2.1\u3001\u5bfc\u5165\u5fc5\u8981\u7684\u5e93<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">import nltk<\/p>\n<p>nltk.download(&#39;punkt&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3.2.2\u3001\u51c6\u5907\u6587\u672c\u6570\u636e<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Python is a high-level programming language. Machine learning and data science are applications of Python.&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3.2.3\u3001\u8fdb\u884c\u5206\u8bcd<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">words = nltk.word_tokenize(text)<\/p>\n<p>print(&quot;Words using NLTK:\\n&quot;, words)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<h2><strong>\u56db\u3001\u4f7f\u7528\u4e3b\u9898\u6a21\u578b<\/strong><\/h2>\n<p><p>\u4e3b\u9898\u6a21\u578b\u662f\u4e00\u79cd\u65e0\u76d1\u7763\u7684\u673a\u5668\u5b66\u4e60\u6280\u672f\uff0c\u7528\u4e8e\u4ece\u5927\u91cf\u6587\u6863\u4e2d\u53d1\u73b0\u6f5c\u5728\u7684\u4e3b\u9898\u3002\u5e38\u89c1\u7684\u4e3b\u9898\u6a21\u578b\u6709LDA\uff08Latent Dirichlet Allocation\uff09\u7b49\u3002<\/p>\n<\/p>\n<p><h2>4.1\u3001\u5bfc\u5165\u5fc5\u8981\u7684\u5e93<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.decomposition import LatentDirichletAllocation<\/p>\n<p>from sklearn.feature_extraction.text import CountVectorizer<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>4.2\u3001\u51c6\u5907\u6587\u672c\u6570\u636e<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">documents = [<\/p>\n<p>    &quot;Python is a high-level programming language.&quot;,<\/p>\n<p>    &quot;Machine learning and data science are applications of Python.&quot;,<\/p>\n<p>    &quot;Python is popular for web development.&quot;,<\/p>\n<p>    &quot;Data analysis and machine learning are key applications of Python.&quot;<\/p>\n<p>]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>4.3\u3001\u8f6c\u6362\u6587\u672c\u6570\u636e<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">vectorizer = CountVectorizer()<\/p>\n<p>data_vectorized = vectorizer.fit_transform(documents)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>4.4\u3001\u8bad\u7ec3LDA\u6a21\u578b<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">lda_model = LatentDirichletAllocation(n_components=2, random_state=42)<\/p>\n<p>lda_model.fit(data_vectorized)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>4.5\u3001\u663e\u793a\u4e3b\u9898\u5173\u952e\u8bcd<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">def print_top_words(model, feature_names, n_top_words):<\/p>\n<p>    for topic_idx, topic in enumerate(model.components_):<\/p>\n<p>        print(&quot;Topic #%d:&quot; % topic_idx)<\/p>\n<p>        print(&quot; &quot;.join([feature_names[i] for i in topic.argsort()[:-n_top_words - 1:-1]]))<\/p>\n<p>    print()<\/p>\n<p>tf_feature_names = vectorizer.get_feature_names_out()<\/p>\n<p>print_top_words(lda_model, tf_feature_names, 5)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<h2><strong>\u4e94\u3001\u4f7f\u7528\u673a\u5668\u5b66\u4e60<\/strong><\/h2>\n<p><p>\u673a\u5668\u5b66\u4e60\u65b9\u6cd5\u53ef\u4ee5\u901a\u8fc7\u8bad\u7ec3\u6a21\u578b\u6765\u81ea\u52a8\u62bd\u53d6\u6587\u672c\u4e2d\u7684\u5173\u952e\u5b57\u3002\u5e38\u89c1\u7684\u673a\u5668\u5b66\u4e60\u65b9\u6cd5\u5305\u62ec\u76d1\u7763\u5b66\u4e60\u548c\u65e0\u76d1\u7763\u5b66\u4e60\u7b49\u3002<\/p>\n<\/p>\n<p><h2>5.1\u3001\u5bfc\u5165\u5fc5\u8981\u7684\u5e93<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.feature_extraction.text import TfidfVectorizer<\/p>\n<p>from sklearn.cluster import KMeans<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>5.2\u3001\u51c6\u5907\u6587\u672c\u6570\u636e<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">documents = [<\/p>\n<p>    &quot;Python is a high-level programming language.&quot;,<\/p>\n<p>    &quot;Machine learning and data science are applications of Python.&quot;,<\/p>\n<p>    &quot;Python is popular for web development.&quot;,<\/p>\n<p>    &quot;Data analysis and machine learning are key applications of Python.&quot;<\/p>\n<p>]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>5.3\u3001\u8f6c\u6362\u6587\u672c\u6570\u636e<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">vectorizer = TfidfVectorizer()<\/p>\n<p>X = vectorizer.fit_transform(documents)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>5.4\u3001\u8bad\u7ec3KMeans\u6a21\u578b<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">kmeans = KMeans(n_clusters=2, random_state=42)<\/p>\n<p>kmeans.fit(X)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>5.5\u3001\u663e\u793a\u805a\u7c7b\u7ed3\u679c<\/h2>\n<\/p>\n<p><pre><code class=\"language-python\">order_centroids = kmeans.cluster_centers_.argsort()[:, ::-1]<\/p>\n<p>terms = vectorizer.get_feature_names_out()<\/p>\n<p>for i in range(2):<\/p>\n<p>    print(&quot;Cluster %d:&quot; % i),<\/p>\n<p>    for ind in order_centroids[i, :5]:<\/p>\n<p>        print(&#39; %s&#39; % terms[ind])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u62bd\u53d6\u6587\u672c\u4e2d\u7684\u5173\u952e\u5b57\u3002\u4e0d\u540c\u7684\u65b9\u6cd5\u6709\u5404\u81ea\u7684\u4f18\u7f3a\u70b9\uff0c\u5177\u4f53\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\u548c\u6570\u636e\u7279\u70b9\u3002\u65e0\u8bba\u662f\u4f7f\u7528TF-IDF\u7b97\u6cd5\u3001TextRank\u7b97\u6cd5\u3001\u5206\u8bcd\u5de5\u5177\u3001\u4e3b\u9898\u6a21\u578b\u8fd8\u662f\u673a\u5668\u5b66\u4e60\u65b9\u6cd5\uff0c\u90fd\u9700\u8981\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u9002\u5f53\u7684\u8c03\u6574\u548c\u4f18\u5316\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684Python\u5e93\u6765\u8fdb\u884c\u5173\u952e\u5b57\u62bd\u53d6\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u6709\u591a\u79cd\u5e93\u53ef\u4ee5\u7528\u6765\u8fdb\u884c\u5173\u952e\u5b57\u62bd\u53d6\uff0c\u5982NLTK\u3001spaCy\u548cGensim\u7b49\u3002\u9009\u62e9\u5408\u9002\u7684\u5e93\u4e3b\u8981\u53d6\u51b3\u4e8e\u4f60\u7684\u9700\u6c42\u3002\u4f8b\u5982\uff0cNLTK\u9002\u5408\u57fa\u7840\u7684\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4efb\u52a1\uff0cspaCy\u5219\u66f4\u9002\u5408\u5904\u7406\u5927\u578b\u6587\u672c\u6570\u636e\u5e76\u5177\u6709\u66f4\u9ad8\u7684\u6027\u80fd\uff0c\u800cGensim\u5728\u4e3b\u9898\u5efa\u6a21\u548c\u8bcd\u5411\u91cf\u65b9\u9762\u8868\u73b0\u7a81\u51fa\u3002\u4e86\u89e3\u5404\u4e2a\u5e93\u7684\u7279\u6027\u548c\u5e94\u7528\u573a\u666f\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u505a\u51fa\u66f4\u660e\u667a\u7684\u9009\u62e9\u3002<\/p>\n<p><strong>\u5173\u952e\u5b57\u62bd\u53d6\u7684\u5e38\u7528\u7b97\u6cd5\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u5728\u8fdb\u884c\u5173\u952e\u5b57\u62bd\u53d6\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u7b97\u6cd5\uff0c\u5176\u4e2d\u5305\u62ecTF-IDF\u3001TextRank\u548cLDA\u7b49\u3002TF-IDF\u662f\u4e00\u79cd\u5e38\u7528\u7684\u7edf\u8ba1\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8861\u91cf\u4e00\u4e2a\u8bcd\u5728\u6587\u6863\u4e2d\u7684\u91cd\u8981\u6027\uff1bTextRank\u662f\u4e00\u79cd\u57fa\u4e8e\u56fe\u7684\u7b97\u6cd5\uff0c\u9002\u5408\u63d0\u53d6\u6587\u672c\u4e2d\u7684\u5173\u952e\u8bcd\u548c\u77ed\u8bed\uff1b\u800cLDA\u5219\u662f\u4e00\u79cd\u4e3b\u9898\u6a21\u578b\uff0c\u53ef\u4ee5\u5e2e\u52a9\u8bc6\u522b\u6587\u6863\u4e2d\u7684\u4e3b\u9898\u53ca\u5176\u5173\u952e\u8bcd\u3002\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u7b97\u6cd5\u53ef\u4ee5\u63d0\u9ad8\u62bd\u53d6\u7684\u51c6\u786e\u6027\u548c\u6548\u7387\u3002<\/p>\n<p><strong>\u5173\u952e\u5b57\u62bd\u53d6\u7684\u7ed3\u679c\u5982\u4f55\u8fdb\u884c\u8bc4\u4f30\uff1f<\/strong><br \/>\u8bc4\u4f30\u5173\u952e\u5b57\u62bd\u53d6\u7684\u6548\u679c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u8fdb\u884c\uff0c\u5305\u62ec\u4eba\u5de5\u8bc4\u5ba1\u548c\u81ea\u52a8\u5316\u8bc4\u4f30\u6307\u6807\u3002\u4eba\u5de5\u8bc4\u5ba1\u53ef\u4ee5\u901a\u8fc7\u4e13\u4e1a\u4eba\u5458\u5bf9\u62bd\u53d6\u7ed3\u679c\u7684\u76f8\u5173\u6027\u548c\u51c6\u786e\u6027\u8fdb\u884c\u6253\u5206\uff0c\u800c\u81ea\u52a8\u5316\u8bc4\u4f30\u5219\u53ef\u4ee5\u4f7f\u7528Precision\u3001Recall\u548cF1 Score\u7b49\u6307\u6807\u6765\u91cf\u5316\u62bd\u53d6\u6548\u679c\u3002\u6b64\u5916\uff0c\u7ed3\u5408\u9886\u57df\u77e5\u8bc6\u548c\u7528\u6237\u53cd\u9988\u4e5f\u80fd\u6709\u6548\u63d0\u5347\u8bc4\u4f30\u7684\u5168\u9762\u6027\u548c\u51c6\u786e\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5982\u4f55\u62bd\u53d6\u5173\u952e\u5b57python\uff1a\u4f7f\u7528TF-IDF\u7b97\u6cd5\u3001\u4f7f\u7528TextRank\u7b97\u6cd5\u3001\u4f7f\u7528\u5206\u8bcd\u5de5\u5177\u3001\u4f7f\u7528\u4e3b\u9898\u6a21\u578b\u3001\u4f7f\u7528\u673a [&hellip;]","protected":false},"author":3,"featured_media":1182106,"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\/1182096"}],"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=1182096"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1182096\/revisions"}],"predecessor-version":[{"id":1182107,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1182096\/revisions\/1182107"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1182106"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1182096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1182096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1182096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}