{"id":101931,"date":"2026-09-07T21:09:06","date_gmt":"2026-09-07T13:09:06","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/101931.html"},"modified":"2026-09-07T21:09:06","modified_gmt":"2026-09-07T13:09:06","slug":"%e6%9c%ba%e6%a2%b0%e5%ad%a6%e4%b9%a0-tf-idf","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/101931.html","title":{"rendered":"\u673a\u68b0\u5b66\u4e60-TF-IDF"},"content":{"rendered":"<p>TF\u2011IDF&#xff08;Term Frequency\u2011Inverse Document Frequency&#xff09;&#xff1a;\u8bcd\u9891\u2011\u9006\u6587\u6863\u9891\u7387&#xff0c;\u7528\u4e8e\u8bc4\u4f30\u4e00\u4e2a\u8bcd\u5728\u67d0\u7bc7\u6587\u6863\u76f8\u5bf9\u4e8e\u6574\u4e2a\u6587\u6863\u96c6\u5408\u7684\u91cd\u8981\u7a0b\u5ea6\u3002&#xff08;\u8bcd\u5728\u5f53\u524d\u6587\u7ae0\u51fa\u73b0\u591a&#xff0c;\u4f46\u5728\u5176\u4ed6\u6587\u7ae0\u5f88\u5c11\u51fa\u73b0 \u2192 TF\u2011IDF \u503c\u5927&#xff0c;\u4ee3\u8868\u8fd9\u4e2a\u8bcd\u5f88\u6709\u533a\u5206\u5ea6\u3002&#xff09;<br \/>\n\u4e00&#xff0c;\u539f\u7406\u89e3\u91ca<br \/>\n1&#xff0c;TF \u8bcd\u9891 Term Frequency<br \/>\n\u67d0\u8bcd\u5728\u5f53\u524d\u6587\u6863\u4e2d\u51fa\u73b0\u7684\u9891\u7387<br \/>\n<span class=\"katex--display\"><span class=\"katex-display\"><span class=\"katex\"><span class=\"katex-mathml\">TF(t,d)&#061;\u8bcdt\u5728\u6587\u6863d\u4e2d\u51fa\u73b0\u6b21\u6570\u6587\u6863d\u603b\u8bcd\u8bed\u6570<br \/>\nTF(t,d)&#061;\\\\frac{\\\\text{\u8bcd}t\\\\text{\u5728\u6587\u6863}d\\\\text{\u4e2d\u51fa\u73b0\u6b21\u6570}}{\\\\text{\u6587\u6863}d\\\\text{\u603b\u8bcd\u8bed\u6570}}<br \/>\n<\/span><span class=\"katex-html\"><span class=\"base\"><span class=\"strut\" style=\"height: 1em;vertical-align: -0.25em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">T<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">F<\/span><span class=\"mopen\">(<\/span><span class=\"mord mathnormal\">t<\/span><span class=\"mpunct\">,<\/span><span class=\"mspace\" style=\"margin-right: 0.1667em\"><\/span><span class=\"mord mathnormal\">d<\/span><span class=\"mclose\">)<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><span class=\"mrel\">&#061;<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><\/span><span class=\"base\"><span class=\"strut\" style=\"height: 2.0574em;vertical-align: -0.686em\"><\/span><span class=\"mord\"><span class=\"mopen nulldelimiter\"><\/span><span class=\"mfrac\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 1.3714em\"><span class=\"\" style=\"top: -2.314em\"><span class=\"pstrut\" style=\"height: 3em\"><\/span><span class=\"mord\"><span class=\"mord text\"><span class=\"mord cjk_fallback\">\u6587\u6863<\/span><\/span><span class=\"mord mathnormal\">d<\/span><span class=\"mord text\"><span class=\"mord cjk_fallback\">\u603b\u8bcd\u8bed\u6570<\/span><\/span><\/span><\/span><span class=\"\" style=\"top: -3.23em\"><span class=\"pstrut\" style=\"height: 3em\"><\/span><span class=\"frac-line\" style=\"border-bottom-width: 0.04em\"><\/span><\/span><span class=\"\" style=\"top: -3.677em\"><span class=\"pstrut\" style=\"height: 3em\"><\/span><span class=\"mord\"><span class=\"mord text\"><span class=\"mord cjk_fallback\">\u8bcd<\/span><\/span><span class=\"mord mathnormal\">t<\/span><span class=\"mord text\"><span class=\"mord cjk_fallback\">\u5728\u6587\u6863<\/span><\/span><span class=\"mord mathnormal\">d<\/span><span class=\"mord text\"><span class=\"mord cjk_fallback\">\u4e2d\u51fa\u73b0\u6b21\u6570<\/span><\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.686em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><span class=\"mclose nulldelimiter\"><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p>2&#xff0c;IDF \u9006\u6587\u6863\u9891\u7387 Inverse Document Frequency<br \/>\n\u8861\u91cf\u8bcd\u8bed\u7684\u666e\u904d\u7a0b\u5ea6&#xff0c;\u8bcd\u8bed\u8d8a\u5e38\u89c1&#xff0c;IDF \u8d8a\u5c0f<br \/>\n<span class=\"katex--display\"><span class=\"katex-display\"><span class=\"katex\"><span class=\"katex-mathml\">IDF(t,D)&#061;log\u2061(\u603b\u6587\u6863\u6570\u5305\u542b\u8bcdt\u7684\u6587\u6863\u6570&#043;1)<br \/>\nIDF(t,D)&#061;\\\\log\\\\left(\\\\frac{\\\\text{\u603b\u6587\u6863\u6570}}{\\\\text{\u5305\u542b\u8bcd}t\\\\text{\u7684\u6587\u6863\u6570}&#043;1}\\\\right)<br \/>\n<\/span><span class=\"katex-html\"><span class=\"base\"><span class=\"strut\" style=\"height: 1em;vertical-align: -0.25em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0785em\">I<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">F<\/span><span class=\"mopen\">(<\/span><span class=\"mord mathnormal\">t<\/span><span class=\"mpunct\">,<\/span><span class=\"mspace\" style=\"margin-right: 0.1667em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mclose\">)<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><span class=\"mrel\">&#061;<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><\/span><span class=\"base\"><span class=\"strut\" style=\"height: 2.4em;vertical-align: -0.95em\"><\/span><span class=\"mop\">lo<span style=\"margin-right: 0.0139em\">g<\/span><\/span><span class=\"mspace\" style=\"margin-right: 0.1667em\"><\/span><span class=\"minner\"><span class=\"mopen delimcenter\" style=\"top: 0em\"><span class=\"delimsizing size3\">(<\/span><\/span><span class=\"mord\"><span class=\"mopen nulldelimiter\"><\/span><span class=\"mfrac\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 1.3603em\"><span class=\"\" style=\"top: -2.314em\"><span class=\"pstrut\" style=\"height: 3em\"><\/span><span class=\"mord\"><span class=\"mord text\"><span class=\"mord cjk_fallback\">\u5305\u542b\u8bcd<\/span><\/span><span class=\"mord mathnormal\">t<\/span><span class=\"mord text\"><span class=\"mord cjk_fallback\">\u7684\u6587\u6863\u6570<\/span><\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">&#043;<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mord\">1<\/span><\/span><\/span><span class=\"\" style=\"top: -3.23em\"><span class=\"pstrut\" style=\"height: 3em\"><\/span><span class=\"frac-line\" style=\"border-bottom-width: 0.04em\"><\/span><\/span><span class=\"\" style=\"top: -3.677em\"><span class=\"pstrut\" style=\"height: 3em\"><\/span><span class=\"mord\"><span class=\"mord text\"><span class=\"mord cjk_fallback\">\u603b\u6587\u6863\u6570<\/span><\/span><\/span><\/span><\/span><span class=\"vlist-s\">\u200b<\/span><\/span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height: 0.7693em\"><span class=\"\"><\/span><\/span><\/span><\/span><\/span><span class=\"mclose nulldelimiter\"><\/span><\/span><span class=\"mclose delimcenter\" style=\"top: 0em\"><span class=\"delimsizing size3\">)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p>3&#xff0c;TF\u2011IDF \u8ba1\u7b97\u516c\u5f0f<br \/>\n<span class=\"katex--display\"><span class=\"katex-display\"><span class=\"katex\"><span class=\"katex-mathml\">TFIDF(t,d,D)&#061;TF(t,d)\u00d7IDF(t,D)<br \/>\nTFIDF(t,d,D)&#061;TF(t,d)\\\\times IDF(t,D)<br \/>\n<\/span><span class=\"katex-html\"><span class=\"base\"><span class=\"strut\" style=\"height: 1em;vertical-align: -0.25em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">T<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">F<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0785em\">I<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">F<\/span><span class=\"mopen\">(<\/span><span class=\"mord mathnormal\">t<\/span><span class=\"mpunct\">,<\/span><span class=\"mspace\" style=\"margin-right: 0.1667em\"><\/span><span class=\"mord mathnormal\">d<\/span><span class=\"mpunct\">,<\/span><span class=\"mspace\" style=\"margin-right: 0.1667em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mclose\">)<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><span class=\"mrel\">&#061;<\/span><span class=\"mspace\" style=\"margin-right: 0.2778em\"><\/span><\/span><span class=\"base\"><span class=\"strut\" style=\"height: 1em;vertical-align: -0.25em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">T<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">F<\/span><span class=\"mopen\">(<\/span><span class=\"mord mathnormal\">t<\/span><span class=\"mpunct\">,<\/span><span class=\"mspace\" style=\"margin-right: 0.1667em\"><\/span><span class=\"mord mathnormal\">d<\/span><span class=\"mclose\">)<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><span class=\"mbin\">\u00d7<\/span><span class=\"mspace\" style=\"margin-right: 0.2222em\"><\/span><\/span><span class=\"base\"><span class=\"strut\" style=\"height: 1em;vertical-align: -0.25em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0785em\">I<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.1389em\">F<\/span><span class=\"mopen\">(<\/span><span class=\"mord mathnormal\">t<\/span><span class=\"mpunct\">,<\/span><span class=\"mspace\" style=\"margin-right: 0.1667em\"><\/span><span class=\"mord mathnormal\" style=\"margin-right: 0.0278em\">D<\/span><span class=\"mclose\">)<\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<ul>\n<li>TF \u9ad8\u3001IDF \u9ad8&#xff1a;\u5728\u672c\u6587\u9891\u7e41\u51fa\u73b0&#xff0c;\u5176\u4ed6\u6587\u6863\u5f88\u5c11\u51fa\u73b0 \u2192 \u5173\u952e\u8bcd<\/li>\n<li>TF \u9ad8\u3001IDF \u4f4e&#xff1a;\u5927\u91cf\u6587\u6863\u90fd\u51fa\u73b0&#xff08;\u4f8b\u5982&#xff1a;\u7684\u3001\u662f&#xff09;\u2192 \u505c\u7528\u8bcd&#xff0c;\u533a\u5206\u4ef7\u503c\u4f4e<\/li>\n<\/ul>\n<p><span class=\"token keyword\">from<\/span> sklearn<span class=\"token punctuation\">.<\/span>feature_extraction<span class=\"token punctuation\">.<\/span>text <span class=\"token keyword\">import<\/span> TfidfVectorizer<br \/>\n<span class=\"token keyword\">import<\/span> pandas <span class=\"token keyword\">as<\/span> pd<br \/>\ninFile <span class=\"token operator\">&#061;<\/span> <span class=\"token builtin\">open<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">r&#034;.\\\\task2_1.txt&#034;<\/span><span class=\"token punctuation\">,<\/span><span class=\"token string\">&#034;r&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token comment\">#\u8bfb\u53d6\u51fd\u6570\u6587\u4ef6<\/span><br \/>\ncorpus <span class=\"token operator\">&#061;<\/span> inFile<span class=\"token punctuation\">.<\/span>readlines<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token comment\">#\u4ee5\u5217\u8868\u5f62\u5f0f\u8bfb\u53d6<\/span><br \/>\nvectorizer <span class=\"token operator\">&#061;<\/span> TfidfVectorizer<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>   <span class=\"token comment\">#\u7c7b&#xff0c;\u8f6c\u4e3aTF-IDF\u7684\u5411\u91cf\u8f6c\u6362\u5bf9\u8c61<\/span><br \/>\ntfidf <span class=\"token operator\">&#061;<\/span> vectorizer<span class=\"token punctuation\">.<\/span>fit_transform<span class=\"token punctuation\">(<\/span>corpus<span class=\"token punctuation\">)<\/span>   <span class=\"token comment\">#\u4f20\u5165\u6570\u636e&#xff0c;\u8fd4\u56de\u5305\u542bTF&#061;IDF\u7684\u5411\u91cf\u503c<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>tfidf<span class=\"token punctuation\">)<\/span><br \/>\nwordlist <span class=\"token operator\">&#061;<\/span> vectorizer<span class=\"token punctuation\">.<\/span>get_feature_names_out<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\">#\u83b7\u53d6\u7279\u5f81\u540d\u79f0&#xff0c;\u6574\u4e2a\u8bed\u6599\u5e93\u7684\u6240\u6709\u8bcd<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>wordlist<span class=\"token punctuation\">)<\/span><br \/>\ndf <span class=\"token operator\">&#061;<\/span> pd<span class=\"token punctuation\">.<\/span>DataFrame<span class=\"token punctuation\">(<\/span>tfidf<span class=\"token punctuation\">.<\/span>T<span class=\"token punctuation\">.<\/span>todense<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span>index <span class=\"token operator\">&#061;<\/span> wordlist<span class=\"token punctuation\">)<\/span><span class=\"token comment\">#tfidf.T.todense()\u6062\u590d\u4e3a\u7a00\u758f\u77e9\u9635<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">for<\/span> j <span class=\"token keyword\">in<\/span> <span class=\"token builtin\">range<\/span><span class=\"token punctuation\">(<\/span><span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>corpus<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    featurelist <span class=\"token operator\">&#061;<\/span> df<span class=\"token punctuation\">.<\/span>iloc<span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">:<\/span><span class=\"token punctuation\">,<\/span>j<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>to_list<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\">#\u901a\u8fc7\u7d22\u5f15\u53f7\u83b7\u53d6\u7b2c\u4e8c\u5217\u7684\u5185\u5bb9\u5e76\u8f6c\u6362\u4e3a\u5217\u8868<\/span><br \/>\n    resdict <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span> <span class=\"token comment\">#\u6392\u5e8f\u4ee5\u53ca\u770b\u8f93\u51fa\u7ed3\u679c\u5bf9\u4e0d\u5bf9<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> i <span class=\"token keyword\">in<\/span> <span class=\"token builtin\">range<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span><span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>wordlist<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        resdict<span class=\"token punctuation\">[<\/span>wordlist<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> featurelist<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span><br \/>\n    resdict <span class=\"token operator\">&#061;<\/span> <span class=\"token builtin\">sorted<\/span><span class=\"token punctuation\">(<\/span>resdict<span class=\"token punctuation\">.<\/span>items<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> key<span class=\"token operator\">&#061;<\/span><span class=\"token keyword\">lambda<\/span>  x<span class=\"token punctuation\">:<\/span>x<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span>reverse<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">True<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>resdict<span class=\"token punctuation\">)<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>TF\u2011IDF&#xff08;Term Frequency\u2011Inverse Document Frequency&#xff09;&#xff1a;\u8bcd\u9891\u2011\u9006\u6587\u6863\u9891\u7387&#xff0c;\u7528\u4e8e\u8bc4\u4f30\u4e00\u4e2a\u8bcd\u5728\u67d0\u7bc7\u6587\u6863\u76f8\u5bf9\u4e8e\u6574\u4e2a\u6587\u6863\u96c6\u5408\u7684\u91cd\u8981\u7a0b\u5ea6\u3002&#xff08;\u8bcd\u5728\u5f53\u524d\u6587\u7ae0\u51fa\u73b0\u591a&#xff0c;\u4f46\u5728\u5176\u4ed6\u6587\u7ae0\u5f88\u5c11\u51fa\u73b0 \u2192 TF\u2011IDF \u503c\u5927&#xff0c;\u4ee3\u8868\u8fd9\u4e2a\u8bcd\u5f88\u6709\u533a\u5206\u5ea6\u3002&#xff09;<br \/>\n\u4e00&#xff0c;\u539f\u7406\u89e3\u91ca<br \/>\n1&#xff0c;TF \u8bcd\u9891 Term Frequency<br \/>\n\u67d0\u8bcd\u5728\u5f53\u524d\u6587\u6863<\/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":[11653,81,5333,50,190,207],"topic":[],"class_list":["post-101931","post","type-post","status-publish","format-standard","hentry","category-server","tag-11653","tag-python","tag-tf-idf","tag-50","tag-190","tag-207"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u673a\u68b0\u5b66\u4e60-TF-IDF - \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\/101931.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u673a\u68b0\u5b66\u4e60-TF-IDF - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"TF\u2011IDF&#xff08;Term Frequency\u2011Inverse Document Frequency&#xff09;&#xff1a;\u8bcd\u9891\u2011\u9006\u6587\u6863\u9891\u7387&#xff0c;\u7528\u4e8e\u8bc4\u4f30\u4e00\u4e2a\u8bcd\u5728\u67d0\u7bc7\u6587\u6863\u76f8\u5bf9\u4e8e\u6574\u4e2a\u6587\u6863\u96c6\u5408\u7684\u91cd\u8981\u7a0b\u5ea6\u3002&#xff08;\u8bcd\u5728\u5f53\u524d\u6587\u7ae0\u51fa\u73b0\u591a&#xff0c;\u4f46\u5728\u5176\u4ed6\u6587\u7ae0\u5f88\u5c11\u51fa\u73b0 \u2192 TF\u2011IDF \u503c\u5927&#xff0c;\u4ee3\u8868\u8fd9\u4e2a\u8bcd\u5f88\u6709\u533a\u5206\u5ea6\u3002&#xff09; \u4e00&#xff0c;\u539f\u7406\u89e3\u91ca 1&#xff0c;TF \u8bcd\u9891 Term Frequency \u67d0\u8bcd\u5728\u5f53\u524d\u6587\u6863\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/101931.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-07T13:09:06+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\/101931.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/101931.html\",\"name\":\"\u673a\u68b0\u5b66\u4e60-TF-IDF - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-07T13:09:06+00:00\",\"dateModified\":\"2026-09-07T13:09:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/101931.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/101931.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/101931.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u673a\u68b0\u5b66\u4e60-TF-IDF\"}]},{\"@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":"\u673a\u68b0\u5b66\u4e60-TF-IDF - \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\/101931.html","og_locale":"zh_CN","og_type":"article","og_title":"\u673a\u68b0\u5b66\u4e60-TF-IDF - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"TF\u2011IDF&#xff08;Term Frequency\u2011Inverse Document Frequency&#xff09;&#xff1a;\u8bcd\u9891\u2011\u9006\u6587\u6863\u9891\u7387&#xff0c;\u7528\u4e8e\u8bc4\u4f30\u4e00\u4e2a\u8bcd\u5728\u67d0\u7bc7\u6587\u6863\u76f8\u5bf9\u4e8e\u6574\u4e2a\u6587\u6863\u96c6\u5408\u7684\u91cd\u8981\u7a0b\u5ea6\u3002&#xff08;\u8bcd\u5728\u5f53\u524d\u6587\u7ae0\u51fa\u73b0\u591a&#xff0c;\u4f46\u5728\u5176\u4ed6\u6587\u7ae0\u5f88\u5c11\u51fa\u73b0 \u2192 TF\u2011IDF \u503c\u5927&#xff0c;\u4ee3\u8868\u8fd9\u4e2a\u8bcd\u5f88\u6709\u533a\u5206\u5ea6\u3002&#xff09; \u4e00&#xff0c;\u539f\u7406\u89e3\u91ca 1&#xff0c;TF \u8bcd\u9891 Term Frequency \u67d0\u8bcd\u5728\u5f53\u524d\u6587\u6863","og_url":"https:\/\/www.wsisp.com\/helps\/101931.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-07T13:09:06+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\/101931.html","url":"https:\/\/www.wsisp.com\/helps\/101931.html","name":"\u673a\u68b0\u5b66\u4e60-TF-IDF - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-07T13:09:06+00:00","dateModified":"2026-09-07T13:09:06+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/101931.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/101931.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/101931.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u673a\u68b0\u5b66\u4e60-TF-IDF"}]},{"@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\/101931","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=101931"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/101931\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=101931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=101931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=101931"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=101931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}