[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-jbesomi--texthero":3,"tool-jbesomi--texthero":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",146793,2,"2026-04-08T23:32:35",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108111,"2026-04-08T11:23:26",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":77,"owner_email":78,"owner_twitter":77,"owner_website":79,"owner_url":80,"languages":81,"stars":102,"forks":103,"last_commit_at":104,"license":105,"difficulty_score":106,"env_os":107,"env_gpu":107,"env_ram":107,"env_deps":108,"category_tags":117,"github_topics":118,"view_count":32,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":128,"updated_at":129,"faqs":130,"releases":161},5732,"jbesomi\u002Ftexthero","texthero","Text preprocessing, representation and visualization from zero to hero.","Texthero 是一款专为快速处理文本数据而设计的 Python 工具包，旨在让开发者无需深厚的语言学背景也能轻松驾驭自然语言处理任务。它无缝集成于 Pandas 之上，继承了其简洁高效的风格，让用户仅需几行代码即可完成从文本预处理、向量化表示到可视化分析的全流程。\n\n面对非结构化的文本数据，传统方法往往难以快速提取洞察，而 Texthero 正是为了解决这一痛点而生。它将复杂的 NLP 流程标准化，帮助用户迅速理解数据背后的核心概念。无论是清洗文本、提取关键词与命名实体，还是利用 TF-IDF 进行特征表示，亦或是通过 K-means、DBSCAN 等算法进行聚类分析和主题建模，Texthero 都提供了开箱即用的解决方案，同时保留了足够的灵活性以支持自定义需求。\n\n这款工具特别适合希望高效探索文本数据集的程序员、数据科学家以及 NLP 初学者。其独特的亮点在于极低的入门门槛与完善的文档支持，让现代开发者能专注于业务逻辑而非繁琐的技术细节。此外，Texthero 作为一个开源社区驱动的项目，正积极拓展多语言支持，欢迎全球开发者共同参与建设。如果你正在寻找一个既能提升效率又能深化理解","Texthero 是一款专为快速处理文本数据而设计的 Python 工具包，旨在让开发者无需深厚的语言学背景也能轻松驾驭自然语言处理任务。它无缝集成于 Pandas 之上，继承了其简洁高效的风格，让用户仅需几行代码即可完成从文本预处理、向量化表示到可视化分析的全流程。\n\n面对非结构化的文本数据，传统方法往往难以快速提取洞察，而 Texthero 正是为了解决这一痛点而生。它将复杂的 NLP 流程标准化，帮助用户迅速理解数据背后的核心概念。无论是清洗文本、提取关键词与命名实体，还是利用 TF-IDF 进行特征表示，亦或是通过 K-means、DBSCAN 等算法进行聚类分析和主题建模，Texthero 都提供了开箱即用的解决方案，同时保留了足够的灵活性以支持自定义需求。\n\n这款工具特别适合希望高效探索文本数据集的程序员、数据科学家以及 NLP 初学者。其独特的亮点在于极低的入门门槛与完善的文档支持，让现代开发者能专注于业务逻辑而非繁琐的技术细节。此外，Texthero 作为一个开源社区驱动的项目，正积极拓展多语言支持，欢迎全球开发者共同参与建设。如果你正在寻找一个既能提升效率又能深化理解的文本分析助手，Texthero 值得尝试。","\u003Cp align=\"center\">\n   \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fstargazers\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fjbesomi\u002Ftexthero.svg?colorA=orange&colorB=orange&logo=github\"\n         alt=\"Github stars\">\n   \u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fsearch\u002F?q=texthero\">\n      \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Ftexthero.svg?colorB=brightgreen\"\n           alt=\"pip package\">\n   \u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Ftexthero\u002F\">\n      \u003Cimg alt=\"pip downloads\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdm\u002Ftexthero\">\n   \u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fjbesomi\u002Ftexthero.svg\"\n             alt=\"Github issues\">\n   \u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fblob\u002Fmaster\u002FLICENSE\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fjbesomi\u002Ftexthero.svg\"\n             alt=\"Github license\">\n   \u003C\u002Fa>   \n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fjbesomi_texthero_readme_ee80fa26fedc.png\">\n\u003C\u002Fp>\n\n\u003Cp style=\"font-size: 20px;\" align=\"center\">Text preprocessing, representation and visualization from zero to hero.\u003C\u002Fp>\n\n\n\u003Cp align=\"center\">\n   \u003Ca href=\"#from-zero-to-hero\">From zero to hero\u003C\u002Fa> •\n   \u003Ca href=\"#installation\">Installation\u003C\u002Fa> •\n   \u003Ca href=\"#getting-started\">Getting Started\u003C\u002Fa> •\n   \u003Ca href=\"#examples\">Examples\u003C\u002Fa> •\n   \u003Ca href=\"#api\">API\u003C\u002Fa> •\n   \u003Ca href=\"#faq\">FAQ\u003C\u002Fa> •\n   \u003Ca href=\"#contributions\">Contributions\u003C\u002Fa>\n\u003C\u002Fp>\n\n\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fjbesomi_texthero_readme_152efd2c0612.gif\">\n\u003C\u002Fp>\n\n\u003Ch2 align=\"center\">From zero to hero\u003C\u002Fh2>\n\nTexthero is a python toolkit to work with text-based dataset quickly and effortlessly. Texthero is very simple to learn and designed to be used on top of Pandas. Texthero has the same expressiveness and power of Pandas and is extensively documented. Texthero is modern and conceived for programmers of the 2020 decade with little knowledge if any in linguistic. \n\nYou can think of Texthero as a tool to help you _understand_ and work with text-based dataset. Given a tabular dataset, it's easy to _grasp the main concept_. Instead, given a text dataset, it's harder to have quick insights into the underline data. With Texthero, preprocessing text data, mapping it into vectors, and visualizing the obtained vector space takes just a couple of lines.\n\nTexthero include tools for:\n* Preprocess text data: it offers both out-of-the-box solutions but it's also flexible for custom-solutions.\n* Natural Language Processing: keyphrases and keywords extraction, and named entity recognition.\n* Text representation: TF-IDF, term frequency, and custom word-embeddings (wip)\n* Vector space analysis: clustering (K-means, Meanshift, DBSCAN and Hierarchical), topic modeling (wip) and interpretation.\n* Text visualization: vector space visualization, place localization on maps (wip).\n\nTexthero is free, open-source and [well documented](https:\u002F\u002Ftexthero.org\u002Fdocs) (and that's what we love most by the way!). \n\nWe hope you will find pleasure working with Texthero as we had during his development.\n\n\u003Ch2 align=\"center\">Hablas español? क्या आप हिंदी बोलते हैं? 日本語が話せるのか？\u003C\u002Fh2>\n\nTexthero has been developed for the whole NLP community. We know how hard it is to deal with different NLP tools (NLTK, SpaCy, Gensim, TextBlob, Sklearn): that's why we developed Texthero, to simplify things.\n\nNow, the next main milestone is to provide *multilingual support* and for this big step, we need the help of all of you. ¿Hablas español? Sie sprechen Deutsch? 你会说中文？ 日本語が話せるのか？ Fala português? Parli Italiano? Вы говорите по-русски? If yes or you speak another language not mentioned here, then you might help us develop multilingual support! Even if you haven't contributed before or you just started with NLP, contact us or open a Github issue, there is always a first time :) We promise you will learn a lot, and, ... who knows? It might help you find your new job as an NLP-developer!\n\nFor improving the python toolkit and provide an even better experience, your aid and feedback are crucial. If you have any problem or suggestion please open a Github [issue](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues), we will be glad to support you and help you.\n\n\n\u003Ch2 align=\"center\">Beta version\u003C\u002Fh2>\n\nTexthero's community is growing fast. Texthero though is still in a beta version; soon, a faster and better version will be released and it will bring some major changes.\n\nFor instance, to give a more granular control over the pipeline, starting from the next version on, all `preprocessing` functions will require as argument an already tokenized text. This will be a major change.\n\nOnce released the stable version (Texthero 2.0), backward compatibility will be respected. Until this point, backward compatibility will be present but it will be weaker.\n\nIf you want to be part of this fast-growing movements, do not hesitate to contribute: [CONTRIBUTING](.\u002FCONTRIBUTING.md)!\n\n\u003Ch2 align=\"center\">Installation\u003C\u002Fh2>\n\nInstall texthero via `pip`:\n\n```bash\npip install texthero\n```\n\n> ☝️Under the hoods, Texthero makes use of multiple NLP and machine learning toolkits such as Gensim, NLTK, SpaCy and scikit-learn. You don't need to install them all separately, pip will take care of that.\n\n> For faster performance, make sure you have installed Spacy version >= 2.2. Also, make sure you have a recent version of python, the higher, the best.\n\n\u003Ch2 align=\"center\">Getting started\u003C\u002Fh2>\n\nThe best way to learn Texthero is through the \u003Ca href=\"https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fgetting-started\">Getting Started\u003C\u002Fa> docs. \n\nIn case you are an advanced python user, then `help(texthero)` should do the work.\n\n\u003Ch2 align=\"center\">Examples\u003C\u002Fh2>\n\n\u003Ch3>1. Text cleaning, TF-IDF representation and Visualization\u003C\u002Fh3>\n\n\n```python\nimport texthero as hero\nimport pandas as pd\n\ndf = pd.read_csv(\n   \"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fraw\u002Fmaster\u002Fdataset\u002Fbbcsport.csv\"\n)\n\ndf['pca'] = (\n   df['text']\n   .pipe(hero.clean)\n   .pipe(hero.tfidf)\n   .pipe(hero.pca)\n)\nhero.scatterplot(df, 'pca', color='topic', title=\"PCA BBC Sport news\")\n```\n\n\u003Cp align=\"center\">\n   \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fraw\u002Fmaster\u002Fgithub\u002Fscatterplot_bbcsport.svg\">\n\u003C\u002Fp>\n\n\u003Ch3>2. Text preprocessing, TF-IDF, K-means and Visualization\u003C\u002Fh3>\n\n```python\nimport texthero as hero\nimport pandas as pd\n\ndf = pd.read_csv(\n    \"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fraw\u002Fmaster\u002Fdataset\u002Fbbcsport.csv\"\n)\n\ndf['tfidf'] = (\n    df['text']\n    .pipe(hero.clean)\n    .pipe(hero.tfidf)\n)\n\ndf['kmeans_labels'] = (\n    df['tfidf']\n    .pipe(hero.kmeans, n_clusters=5)\n    .astype(str)\n)\n\ndf['pca'] = df['tfidf'].pipe(hero.pca)\n\nhero.scatterplot(df, 'pca', color='kmeans_labels', title=\"K-means BBC Sport news\")\n```\n\n\u003Cp align=\"center\">\n   \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fraw\u002Fmaster\u002Fgithub\u002Fscatterplot_bbcsport_kmeans.svg\">\n\u003C\u002Fp>\n\n\u003Ch3>3. Simple pipeline for text cleaning\u003C\u002Fh3>\n\n```python\n>>> import texthero as hero\n>>> import pandas as pd\n>>> text = \"This sèntencé    (123 \u002F) needs to [OK!] be cleaned!   \"\n>>> s = pd.Series(text)\n>>> s\n0    This sèntencé    (123 \u002F) needs to [OK!] be cleane...\ndtype: object\n```\n\nRemove all digits:\n\n```python\n>>> s = hero.remove_digits(s)\n>>> s\n0    This sèntencé    (  \u002F) needs to [OK!] be cleaned!\ndtype: object\n```\n\n> Remove digits replaces only blocks of digits. The digits in the string \"hello123\" will not be removed. If we want to remove all digits, you need to set only_blocks to false.\n\nRemove all types of brackets and their content.\n\n```python\n>>> s = hero.remove_brackets(s)\n>>> s \n0    This sèntencé    needs to  be cleaned!\ndtype: object\n```\n\nRemove diacritics.\n\n```python\n>>> s = hero.remove_diacritics(s)\n>>> s \n0    This sentence    needs to  be cleaned!\ndtype: object\n```\n\nRemove punctuation.\n\n```python\n>>> s = hero.remove_punctuation(s)\n>>> s \n0    This sentence    needs to  be cleaned\ndtype: object\n```\n\nRemove extra white-spaces.\n\n```python\n>>> s = hero.remove_whitespace(s)\n>>> s \n0    This sentence needs to be cleaned\ndtype: object\n```\n\nSometimes we also want to get rid of stop-words.\n\n```python\n>>> s = hero.remove_stopwords(s)\n>>> s\n0    This sentence needs cleaned\ndtype: object\n```\n\n\u003Ch2 align=\"center\">API\u003C\u002Fh2>\n\nTexthero is composed of four modules: [preprocessing.py](\u002Ftexthero\u002Fpreprocessing.py), [nlp.py](\u002Ftexthero\u002Fnlp.py), [representation.py](\u002Ftexthero\u002Frepresentation.py) and [visualization.py](\u002Ftexthero\u002Fvisualization.py).\n\n\u003Ch3>1. Preprocessing\u003C\u002Fh3>\n\n**Scope:** prepare **text** data for further analysis.\n\nFull documentation: [preprocessing](https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fapi-preprocessing)\n\n\u003Ch3>2. NLP\u003C\u002Fh3>\n\n**Scope:** provide classic natural language processing tools such as `named_entity` and `noun_phrases`.\n\nFull documentation: [nlp](https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fapi-nlp)\n\n\n\u003Ch3>2. Representation\u003C\u002Fh3>\n\n**Scope:** map text data into vectors and do dimensionality reduction.\n\nSupported **representation** algorithms:\n1. Term frequency (`count`)\n1. Term frequency-inverse document frequency (`tfidf`)\n\nSupported **clustering** algorithms:\n1. K-means (`kmeans`)\n1. Density-Based Spatial Clustering of Applications with Noise (`dbscan`)\n1. Meanshift (`meanshift`)\n\nSupported **dimensionality reduction** algorithms:\n1. Principal component analysis (`pca`)\n1. t-distributed stochastic neighbor embedding (`tsne`)\n1. Non-negative matrix factorization (`nmf`)\n\nFull documentation: [representation](https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fapi-representation)\n\n\u003Ch3>3. Visualization\u003C\u002Fh3>\n\n**Scope:** summarize the main facts regarding the text data and visualize it. This module is opinionable. It's handy for anyone that needs a quick solution to visualize on screen the text data, for instance during a text exploratory data analysis (EDA).\n\nSupported functions:\n   - Text scatterplot (`scatterplot`)\n   - Most common words (`top_words`)\n\nFull documentation: [visualization](https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fapi-visualization)\n\n\u003Ch2 align=\"center\">FAQ\u003C\u002Fh2>\n\n\u003Ch5>Why Texthero\u003C\u002Fh5>\n\nSometimes we just want things done, right? Texthero helps with that. It helps make things easier and give the developer more time to focus on his custom requirements. We believe that cleaning text should just take a minute. Same for finding the most important part of a text and the same for representing it.\n\nIn a very pragmatic way, texthero has just one goal: make the developer spare time. Working with text data can be a pain and in most cases, a default pipeline can be quite good to start. There is always time to come back and improve previous work.\n\n\n\u003Ch2 align=\"center\">Contributions\u003C\u002Fh2>\n\n> \"Texthero has been developed by a member of the NLP community for the whole NLP-community\"\n\nTexthero is for all of us NLP-developers and it can continue to exist with the precious contribution of the community.\n\nYour level of expertise of python and NLP does not matter, anyone can help and anyone is more than welcome to contribute!\n\n**Are you an NLP expert?**\n\n- [open an issue](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues) and tell us what you like and dislike of Texthero and what we can do better!\n\n**Are you good at creating websites?**\n\nThe website will be soon moved from Docusaurus to Sphinx: read the [open issue there](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F40). Good news: the website will look like now :) Average news: we need to do some web-development to adapt [this Sphinx template](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F40) to our needs. Can you help us?\n\n**Are you good at writing?**\n\nProbably this is the most important piece missing now on Texthero: more tutorials and more \"Getting Started\" guide. \n\nIf you are good at writing you can help us! Why don't you start by [Adding a FAQ page to the website](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F41) or explain how to [create a custom pipeline](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F38)? Need help? We are there for you.\n\n**Are you good in python?**\n\nThere are a lot of [open issues](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues) for techie guys. Which one do you choose?\n\nIf you have just other questions or inquiry drop me a line at jonathanbesomi__AT__gmail.com\n\n\u003Ch3>Contributors (in chronological order)\u003C\u002Fh3>\n\n- [Selim Al Awwa](https:\u002F\u002Fgithub.com\u002Fselimelawwa\u002F)\n- [Parth Gandhi](https:\u002F\u002Fgithub.com\u002FParthGandhi)\n- [Dan Keefe](https:\u002F\u002Fgithub.com\u002FPeritract)\n- [Christian Claus](https:\u002F\u002Fgithub.com\u002Fcclauss)\n- [bobfang1992](https:\u002F\u002Fgithub.com\u002Fbobfang1992)\n- [Ishan Arora](https:\u002F\u002Fgithub.com\u002Fishanarora04)\n- [Vidya P](https:\u002F\u002Fgithub.com\u002Fvidyap-xgboost)\n- [Cedric Conol](https:\u002F\u002Fgithub.com\u002Fcedricconol)\n- [Rich Ramalho](https:\u002F\u002Fgithub.com\u002Frichecr)\n\n\n\u003Ch2 align=\"center\">\u003Ca href=\".\u002FLICENSE\">License\u003C\u002Fa>\u003C\u002Fh2>\n\nThe MIT License (MIT)\n\nCopyright (c) 2020 Texthero\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\u002For sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","\u003Cp align=\"center\">\n   \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fstargazers\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fjbesomi\u002Ftexthero.svg?colorA=orange&colorB=orange&logo=github\"\n         alt=\"GitHub 星标\">\n   \u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fsearch\u002F?q=texthero\">\n      \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Ftexthero.svg?colorB=brightgreen\"\n           alt=\"pip 包\">\n   \u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Ftexthero\u002F\">\n      \u003Cimg alt=\"pip 下载量\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdm\u002Ftexthero\">\n   \u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fjbesomi\u002Ftexthero.svg\"\n             alt=\"GitHub 问题\">\n   \u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fblob\u002Fmaster\u002FLICENSE\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fjbesomi\u002Ftexthero.svg\"\n             alt=\"GitHub 许可证\">\n   \u003C\u002Fa>   \n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fjbesomi_texthero_readme_ee80fa26fedc.png\">\n\u003C\u002Fp>\n\n\u003Cp style=\"font-size: 20px;\" align=\"center\">从零到英雄：文本预处理、表示与可视化。\u003C\u002Fp>\n\n\n\u003Cp align=\"center\">\n   \u003Ca href=\"#from-zero-to-hero\">从零到英雄\u003C\u002Fa> •\n   \u003Ca href=\"#installation\">安装\u003C\u002Fa> •\n   \u003Ca href=\"#getting-started\">入门\u003C\u002Fa> •\n   \u003Ca href=\"#examples\">示例\u003C\u002Fa> •\n   \u003Ca href=\"#api\">API\u003C\u002Fa> •\n   \u003Ca href=\"#faq\">常见问题解答\u003C\u002Fa> •\n   \u003Ca href=\"#contributions\">贡献\u003C\u002Fa>\n\u003C\u002Fp>\n\n\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fjbesomi_texthero_readme_152efd2c0612.gif\">\n\u003C\u002Fp>\n\n\u003Ch2 align=\"center\">从零到英雄\u003C\u002Fh2>\n\nTexthero 是一个 Python 工具包，旨在快速且轻松地处理基于文本的数据集。Texthero 非常易于学习，并专为在 Pandas 基础之上使用而设计。它具备与 Pandas 同样的表达能力和强大功能，并且文档非常详尽。Texthero 具有现代感，专为 2020 年代的程序员打造，即使他们对语言学知识了解不多甚至完全没有。\n\n你可以将 Texthero 看作是帮助你理解和处理文本数据集的工具。对于表格型数据集来说，很容易就能把握其核心概念；然而，对于文本数据集而言，要迅速洞察其背后的数据则相对困难。借助 Texthero，只需几行代码即可完成文本数据的预处理、将其映射为向量，以及可视化得到的向量空间。\n\nTexthero 包含以下工具：\n* 文本数据预处理：既提供开箱即用的解决方案，也支持自定义方案。\n* 自然语言处理：关键短语和关键词提取，以及命名实体识别。\n* 文本表示：TF-IDF、词频，以及自定义词嵌入（开发中）。\n* 向量空间分析：聚类（K-means、Meanshift、DBSCAN 和层次聚类）、主题建模（开发中）及结果解释。\n* 文本可视化：向量空间可视化、地图上的位置定位（开发中）。\n\nTexthero 是免费的开源工具，并且[文档完善](https:\u002F\u002Ftexthero.org\u002Fdocs)——这也是我们最喜欢的地方！\n\n我们希望你在使用 Texthero 的过程中能像我们在开发时一样，感受到其中的乐趣。\n\n\u003Ch2 align=\"center\">你会说西班牙语吗？你会说印地语吗？你会说日语吗？\u003C\u002Fh2>\n\nTexthero 是为整个 NLP 社区开发的。我们知道，面对各种 NLP 工具（NLTK、SpaCy、Gensim、TextBlob、Scikit-learn）是多么令人头疼；因此，我们开发了 Texthero 来简化这一过程。\n\n接下来的主要目标是提供*多语言支持*，而为了实现这一重要一步，我们需要大家的帮助。你会说西班牙语吗？你会说德语吗？你会说中文吗？你会说日语吗？你会说葡萄牙语吗？你会说意大利语吗？你会说俄语吗？如果你会以上任何一种语言，或者会其他未提及的语言，那么你就可以帮助我们开发多语言支持！即使你之前从未做过贡献，或者刚刚开始接触 NLP，也请联系我们或在 GitHub 上提交一个问题，因为总会有第一次的 :) 我们保证你会学到很多东西，而且……谁知道呢？这也许能帮你找到一份 NLP 开发者的工作！\n\n为了改进这个 Python 工具包并提供更好的体验，你的帮助和反馈至关重要。如果你有任何问题或建议，请在 GitHub 上提交一个[问题](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues)，我们将非常乐意为你提供支持并协助解决。\n\n\u003Ch2 align=\"center\">测试版\u003C\u002Fh2>\n\nTexthero 的社区正在迅速壮大。不过，Texthero 目前仍处于测试版阶段；很快，一个更快、更好的版本将会发布，并带来一些重大变化。\n\n例如，为了更精细地控制数据处理流程，从下一个版本开始，所有的 `preprocessing` 函数都将要求输入已经分词后的文本。这将是一项重大变更。\n\n一旦稳定版（Texthero 2.0）发布，将保持向后兼容性。在此之前，虽然也会有一定的向后兼容性，但会相对较弱。\n\n如果你想参与到这场快速发展的浪潮中，千万不要犹豫，立即贡献吧：[CONTRIBUTING](.\u002FCONTRIBUTING.md)！\n\n\u003Ch2 align=\"center\">安装\u003C\u002Fh2>\n\n通过 `pip` 安装 Texthero：\n\n```bash\npip install texthero\n```\n\n> ☝️ 在底层，Texthero 使用了多个 NLP 和机器学习工具包，如 Gensim、NLTK、SpaCy 和 scikit-learn。你无需单独安装这些工具，`pip` 会自动处理。\n\n> 为了获得更好的性能，确保你已安装 SpaCy 2.2 或更高版本。同时，建议使用较新的 Python 版本，版本越高越好。\n\n\u003Ch2 align=\"center\">入门\u003C\u002Fh2>\n\n学习 Texthero 的最佳方式是阅读\u003Ca href=\"https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fgetting-started\">入门文档\u003C\u002Fa>。\n\n如果你是一位高级 Python 用户，那么直接使用 `help(texthero)` 也应该足够了。\n\n\u003Ch2 align=\"center\">示例\u003C\u002Fh2>\n\n\u003Ch3>1. 文本清洗、TF-IDF 表示及可视化\u003C\u002Fh3>\n\n\n```python\nimport texthero as hero\nimport pandas as pd\n\ndf = pd.read_csv(\n   \"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fraw\u002Fmaster\u002Fdataset\u002Fbbcsport.csv\"\n)\n\ndf['pca'] = (\n   df['text']\n   .pipe(hero.clean)\n   .pipe(hero.tfidf)\n   .pipe(hero.pca)\n)\nhero.scatterplot(df, 'pca', color='topic', title=\"BBC Sport 新闻的 PCA 可视化\")\n```\n\n\u003Cp align=\"center\">\n   \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fraw\u002Fmaster\u002Fgithub\u002Fscatterplot_bbcsport.svg\">\n\u003C\u002Fp>\n\n\u003Ch3>2. 文本预处理、TF-IDF、K-means 聚类及可视化\u003C\u002Fh3>\n\n```python\nimport texthero as hero\nimport pandas as pd\n\ndf = pd.read_csv(\n    \"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fraw\u002Fmaster\u002Fdataset\u002Fbbcsport.csv\"\n)\n\ndf['tfidf'] = (\n    df['text']\n    .pipe(hero.clean)\n    .pipe(hero.tfidf)\n)\n\ndf['kmeans_labels'] = (\n    df['tfidf']\n    .pipe(hero.kmeans, n_clusters=5)\n    .astype(str)\n)\n\ndf['pca'] = df['tfidf'].pipe(hero.pca)\n\nhero.scatterplot(df, 'pca', color='kmeans_labels', title=\"BBC Sport 新闻的 K-means 聚类可视化\")\n```\n\n\u003Cp align=\"center\">\n   \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fraw\u002Fmaster\u002Fgithub\u002Fscatterplot_bbcsport_kmeans.svg\">\n\u003C\u002Fp>\n\n\u003Ch3>3. 简单的文本清洗流水线\u003C\u002Fh3>\n\n```python\n>>> import texthero as hero\n>>> import pandas as pd\n>>> text = \"This sèntencé    (123 \u002F) needs to [OK!] be cleaned!   \"\n>>> s = pd.Series(text)\n>>> s\n0    This sèntencé    (123 \u002F) needs to [OK!] be cleane...\ndtype: object\n```\n\n移除所有数字：\n\n```python\n>>> s = hero.remove_digits(s)\n>>> s\n0    This sèntencé    (  \u002F) needs to [OK!] be cleaned!\ndtype: object\n```\n\n> 移除数字功能仅替换连续的数字块。例如，字符串“hello123”中的数字不会被移除。如果需要移除所有数字，则需将参数`only_blocks`设置为`False`。\n\n移除所有类型的括号及其内容。\n\n```python\n>>> s = hero.remove_brackets(s)\n>>> s \n0    This sèntencé    needs to  be cleaned!\ndtype: object\n```\n\n移除变音符号。\n\n```python\n>>> s = hero.remove_diacritics(s)\n>>> s \n0    This sentence    needs to  be cleaned!\ndtype: object\n```\n\n移除标点符号。\n\n```python\n>>> s = hero.remove_punctuation(s)\n>>> s \n0    This sentence    needs to  be cleaned\ndtype: object\n```\n\n移除多余的空格。\n\n```python\n>>> s = hero.remove_whitespace(s)\n>>> s \n0    This sentence needs to be cleaned\ndtype: object\n```\n\n有时我们还想去除停用词。\n\n```python\n>>> s = hero.remove_stopwords(s)\n>>> s\n0    This sentence needs cleaned\ndtype: object\n```\n\n\u003Ch2 align=\"center\">API\u003C\u002Fh2>\n\nTexthero由四个模块组成：[preprocessing.py](\u002Ftexthero\u002Fpreprocessing.py)、[nlp.py](\u002Ftexthero\u002Fnlp.py)、[representation.py](\u002Ftexthero\u002Frepresentation.py)和[visualization.py](\u002Ftexthero\u002Fvisualization.py)。\n\n\u003Ch3>1. 预处理\u003C\u002Fh3>\n\n**范围：**为后续分析准备**文本**数据。\n\n完整文档：[预处理](https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fapi-preprocessing)\n\n\u003Ch3>2. 自然语言处理\u003C\u002Fh3>\n\n**范围：**提供经典自然语言处理工具，如`named_entity`和`noun_phrases`。\n\n完整文档：[NLP](https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fapi-nlp)\n\n\n\u003Ch3>2. 表征\u003C\u002Fh3>\n\n**范围：**将文本数据映射为向量，并进行降维。\n\n支持的**表征**算法：\n1. 词频（`count`）\n1. 词频-逆文档频率（`tfidf`）\n\n支持的**聚类**算法：\n1. K均值（`kmeans`）\n1. 基于密度的空间聚类算法（`dbscan`）\n1. 均值漂移（`meanshift`）\n\n支持的**降维**算法：\n1. 主成分分析（`pca`）\n1. t分布随机邻域嵌入（`tsne`）\n1. 非负矩阵分解（`nmf`）\n\n完整文档：[表征](https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fapi-representation)\n\n\u003Ch3>3. 可视化\u003C\u002Fh3>\n\n**范围：**总结文本数据的主要特征并进行可视化。该模块具有一定的主观性。对于需要快速在屏幕上可视化文本数据的人来说非常实用，例如在文本探索性数据分析（EDA）过程中。\n\n支持的功能：\n   - 文本散点图（`scatterplot`）\n   - 最常见词汇（`top_words`）\n\n完整文档：[可视化](https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fapi-visualization)\n\n\u003Ch2 align=\"center\">常见问题解答\u003C\u002Fh2>\n\n\u003Ch5>为什么叫Texthero？\u003C\u002Fh5>\n\n有时候我们就是希望事情能快速搞定，对吧？Texthero正是为此而生。它让工作更简单，让开发者有更多时间专注于自己的定制需求。我们认为，清理文本只需一分钟就够了。找到文本中最关键的部分以及对其进行表征也同样如此。\n\n从非常务实的角度来看，Texthero只有一个目标：为开发者节省时间。处理文本数据往往很繁琐，但在大多数情况下，使用默认流程就已经足够好了。之后随时可以回过头来优化和完善。\n\n\u003Ch2 align=\"center\">贡献\u003C\u002Fh2>\n\n> “Texthero是由NLP社区的一员为整个NLP社区开发的”\n\nTexthero属于我们所有NLP开发者，并且能够持续发展离不开社区的宝贵贡献。\n\n无论你对Python和NLP的掌握程度如何，任何人都可以提供帮助，也热烈欢迎所有人参与贡献！\n\n**你是NLP专家吗？**\n\n- [提交一个问题](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues)告诉我们你对Texthero的看法，哪些地方你喜欢，哪些地方不喜欢，以及我们可以如何改进！\n\n**你擅长创建网站吗？**\n\n网站很快将从Docusaurus迁移到Sphinx平台：请参阅那里的[开放问题](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F40)。好消息是：网站外观将保持不变 :) 普通消息是：我们需要进行一些网页开发，以使[这个Sphinx模板](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F40)适应我们的需求。你能帮我们吗？\n\n**你擅长写作吗？**\n\n目前Texthero最缺乏的就是更多的教程和“入门指南”。\n\n如果你擅长写作，就可以帮助我们！为什么不先从[为网站添加FAQ页面](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F41)开始，或者解释一下如何[创建自定义管道](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F38)呢？需要帮助吗？我们随时为你提供支持。\n\n**你精通Python吗？**\n\n针对技术型人才，有许多[开放的问题](https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues)。你会选择哪一个呢？\n\n如果你还有其他问题或咨询，请发送邮件至jonathanbesomi__AT__gmail.com\n\n\u003Ch3>贡献者（按时间顺序）\u003C\u002Fh3>\n\n- [Selim Al Awwa](https:\u002F\u002Fgithub.com\u002Fselimelawwa\u002F)\n- [Parth Gandhi](https:\u002F\u002Fgithub.com\u002FParthGandhi)\n- [Dan Keefe](https:\u002F\u002Fgithub.com\u002FPeritract)\n- [Christian Claus](https:\u002F\u002Fgithub.com\u002Fcclauss)\n- [bobfang1992](https:\u002F\u002Fgithub.com\u002Fbobfang1992)\n- [Ishan Arora](https:\u002F\u002Fgithub.com\u002Fishanarora04)\n- [Vidya P](https:\u002F\u002Fgithub.com\u002Fvidyap-xgboost)\n- [Cedric Conol](https:\u002F\u002Fgithub.com\u002Fcedricconol)\n- [Rich Ramalho](https:\u002F\u002Fgithub.com\u002Frichecr)\n\n\n\u003Ch2 align=\"center\">\u003Ca href=\".\u002FLICENSE\">许可证\u003C\u002Fa>\u003C\u002Fh2>\n\nMIT 许可证（MIT）\n\n版权所有 © 2020 Texthero\n\n特此授予任何人免费获取本软件及相关文档文件（以下简称“软件”）副本的权利，允许其在不受限制的情况下处理软件，包括但不限于以下权利：使用、复制、修改、合并、发布、分发、再许可及出售软件副本，并允许向任何接收方提供软件以供使用，但须遵守以下条件：\n\n上述版权声明及本许可声明应包含在软件的所有副本或实质性部分中。\n\n软件按“原样”提供，不提供任何形式的明示或暗示担保，包括但不限于适销性、特定用途适用性和非侵权性。在任何情况下，作者或版权所有者均不对因合同、侵权或其他原因引起的任何索赔、损害赔偿或其他责任负责，这些责任可能源于或与软件的使用或与其他方面的交易有关。","# Texthero 快速上手指南\n\nTexthero 是一个基于 Python 的文本处理工具包，旨在让开发者能够轻松、快速地对文本数据进行预处理、向量化表示和可视化。它构建在 Pandas 之上，语法简洁，非常适合进行探索性数据分析（EDA）。\n\n## 环境准备\n\n*   **操作系统**：支持 Windows、macOS 和 Linux。\n*   **Python 版本**：建议使用较新的 Python 版本（3.7+），版本越高性能越好。\n*   **前置依赖**：\n    *   Texthero 底层依赖多个 NLP 和机器学习库（如 Gensim, NLTK, SpaCy, scikit-learn）。\n    *   **无需手动单独安装**这些依赖，`pip` 在安装 Texthero 时会自动处理。\n    *   为了获得更佳性能，请确保安装后 Spacy 版本 >= 2.2。\n\n## 安装步骤\n\n使用 `pip` 即可一键安装：\n\n```bash\npip install texthero\n```\n\n> **国内加速提示**：如果下载速度较慢，可以使用国内镜像源安装：\n> ```bash\n> pip install texthero -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n## 基本使用\n\nTexthero 的核心设计理念是与 Pandas 无缝集成，通过 `.pipe()` 方法链式调用即可完成从清洗到可视化的全流程。\n\n### 1. 完整流程示例：清洗、TF-IDF 降维与可视化\n\n以下示例展示如何读取数据集，清理文本，将其转换为 TF-IDF 向量，使用 PCA 降维，并绘制散点图。\n\n```python\nimport texthero as hero\nimport pandas as pd\n\n# 加载示例数据集\ndf = pd.read_csv(\n   \"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fraw\u002Fmaster\u002Fdataset\u002Fbbcsport.csv\"\n)\n\n# 构建处理管道：清洗 -> TF-IDF 向量化 -> PCA 降维\ndf['pca'] = (\n   df['text']\n   .pipe(hero.clean)\n   .pipe(hero.tfidf)\n   .pipe(hero.pca)\n)\n\n# 可视化结果\nhero.scatterplot(df, 'pca', color='topic', title=\"PCA BBC Sport news\")\n```\n\n### 2. 文本清洗示例\n\nTexthero 提供了丰富的预处理函数，可以单独或组合使用来清理文本数据。\n\n```python\nimport texthero as hero\nimport pandas as pd\n\n# 原始文本\ntext = \"This sèntencé    (123 \u002F) needs to [OK!] be cleaned!   \"\ns = pd.Series([text])\n\n# 移除数字块\ns = hero.remove_digits(s)\n\n# 移除括号及其内容\ns = hero.remove_brackets(s)\n\n# 移除重音符号 (例如 sèntencé -> sentence)\ns = hero.remove_diacritics(s)\n\n# 移除标点符号\ns = hero.remove_punctuation(s)\n\n# 移除多余空白字符\ns = hero.remove_whitespace(s)\n\n# 移除停用词\ns = hero.remove_stopwords(s)\n\nprint(s)\n# 输出: 0    This sentence needs cleaned\n# dtype: object\n```\n\n### 3. 聚类分析示例\n\n结合 K-means 算法对文本进行聚类并可视化：\n\n```python\nimport texthero as hero\nimport pandas as pd\n\ndf = pd.read_csv(\n    \"https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fraw\u002Fmaster\u002Fdataset\u002Fbbcsport.csv\"\n)\n\n# 文本向量化\ndf['tfidf'] = (\n    df['text']\n    .pipe(hero.clean)\n    .pipe(hero.tfidf)\n)\n\n# K-means 聚类\ndf['kmeans_labels'] = (\n    df['tfidf']\n    .pipe(hero.kmeans, n_clusters=5)\n    .astype(str)\n)\n\n# PCA 降维用于绘图\ndf['pca'] = df['tfidf'].pipe(hero.pca)\n\n# 绘制带聚类标签的散点图\nhero.scatterplot(df, 'pca', color='kmeans_labels', title=\"K-means BBC Sport news\")\n```","某电商数据分析师需要快速从数万条用户评论中提取核心诉求并可视化分布，以辅助产品迭代决策。\n\n### 没有 texthero 时\n- 需手动串联 NLTK、SpaCy 和 Scikit-learn 等多个库，编写大量样板代码进行清洗和向量化，环境配置繁琐且易出错。\n- 缺乏统一的预处理流水线，每次尝试不同的去停用词或词干提取策略时，都要重构整个数据处理逻辑。\n- 难以直观理解高维文本数据，需要额外编写复杂的 Matplotlib 或 Plotly 代码才能将聚类结果映射为可视化的向量空间图。\n- 对非 NLP 专业的开发者门槛极高，调试分词错误或向量维度不匹配问题耗费了大部分分析时间。\n\n### 使用 texthero 后\n- 仅需几行基于 Pandas 风格的代码，即可一键完成从文本清洗、TF-IDF 向量化到 K-means 聚类的全流程，大幅降低开发复杂度。\n- 利用内置的模块化管道，灵活切换预处理方案（如自定义停止词或提取关键短语），无需重写底层逻辑即可对比效果。\n- 调用内置可视化函数，直接生成直观的向量空间散点图或主题分布图，瞬间洞察评论数据的潜在结构和异常点。\n- 让业务人员也能轻松上手，将精力从繁琐的代码调试转移到解读数据背后的业务含义，显著缩短从数据到洞察的周期。\n\ntexthero 通过将复杂的 NLP 流程封装为简洁的 Pandas 风格操作，让文本数据分析真正实现了从“从零开始”到“游刃有余”的跨越。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fjbesomi_texthero_152efd2c.gif","jbesomi","Jonathan Besomi","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fjbesomi_3304d5f1.jpg","Building AI-powered tools",null,"jonathanbesomi@gmail.com","jbesomi.com","https:\u002F\u002Fgithub.com\u002Fjbesomi",[82,86,90,94,98],{"name":83,"color":84,"percentage":85},"Python","#3572A5",71.5,{"name":87,"color":88,"percentage":89},"JavaScript","#f1e05a",14.9,{"name":91,"color":92,"percentage":93},"CSS","#663399",12.9,{"name":95,"color":96,"percentage":97},"Shell","#89e051",0.6,{"name":99,"color":100,"percentage":101},"Dockerfile","#384d54",0.1,2909,237,"2026-04-02T08:40:01","MIT",1,"未说明",{"notes":109,"python":110,"dependencies":111},"该工具目前处于 Beta 版本，未来版本（2.0）可能会有重大变更（如预处理函数将要求输入已分词的文本）。安装时 pip 会自动处理依赖库，无需单独安装。为了获得更快的性能，请确保 SpaCy 版本大于等于 2.2。","建议最新版本 (recent version)",[112,113,114,115,116],"Gensim","NLTK","SpaCy>=2.2","scikit-learn","Pandas",[16,35,14],[119,120,121,122,123,124,125,126,127,64],"text-preprocessing","text-representation","text-visualization","nlp","word-embeddings","machine-learning","text-mining","nlp-pipeline","text-clustering","2026-03-27T02:49:30.150509","2026-04-09T09:32:48.558446",[131,136,141,146,151,156],{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},25990,"导入 texthero 时出现 'ModuleNotFoundError: No module named gensim.sklearn_api' 错误怎么办？","该问题通常由版本不兼容引起。解决方法是安装最新版本的 texthero，可以通过以下命令直接从 GitHub 安装：\npip install git+https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero.git\n或者等待并安装修复了该问题的发布版本（如 1.1.0 及以上）。","https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F210",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},25991,"为什么在 Pandas DataFrame 的单元格中存储列表（List）是被允许的，是否有更好的替代方案？","经过讨论和性能测试，目前结论是保留 `VectorSeries` 和 `TokenSeries` 在单元格中存储列表的形式。原因是将其插入现有 DataFrame 的其他替代方案（如使用 MultiIndex 子列或稀疏矩阵格式）对用户来说开销过大或过于复杂。虽然将矩阵放入 DataFrame 耗时较长，但在处理大规模数据时是可以接受的权衡。","https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F151",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},25992,"如何在 Texthero 中移除文本中的表情符号（Emoji）？","Texthero 支持移除表情符号功能。实现上建议直接使用正则表达式，而无需额外引入沉重的 `emoji` 依赖包。你可以复制 `emoji.get_emoji_regexp()` 生成的正则表达式模式到代码中，用于匹配并替换掉文本中的表情符号。","https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F111",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},25993,"如何为乌尔都语（Urdu）或其他阿拉伯脚本语言正确移除变音符号而不发生转写错误？","默认的移除变音符号函数可能会错误地将乌尔都语字符转写为拉丁字母。解决方案是改进 `remove_diacritics` 函数，使其能够区分必须保留的变音符号和可以移除的变音符号。建议添加可选参数，允许用户指定要保留或移除的特定变音符号列表（如 zabar, pesh, zer 等），以适配不同语言的需求。","https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F71",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},25994,"生成词云（wordcloud）时图像模糊怎么办？","为了减少词云图像的模糊现象，建议在生成时确保图像的宽度和高度尺寸相同，即生成正方形的图像。此外，注意文档字符串（docstring）的行长应尽量保持在 75 个字符以内以便于阅读，但这不影响运行效果。","https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F102",{"id":157,"question_zh":158,"answer_zh":159,"source_url":160},25995,"Texthero 是否支持词形还原（Lemmatization）功能？","是的，Texthero 支持词形还原功能。该功能基于 spaCy 库实现，比简单的词干提取（stemming）更高级。用户可以在 NLP 模块中调用相关函数（如 `hero.lemmatize`）来处理 `TokenSeries` 或文本序列，从而获得更准确的词汇原形。","https:\u002F\u002Fgithub.com\u002Fjbesomi\u002Ftexthero\u002Fissues\u002F173",[162,167,172,177],{"id":163,"version":164,"summary_zh":165,"released_at":166},163372,"1.1.0","- 修复包版本（如 #206）\n- 仅在需要时惰性加载停用词（如 #194）\n- 通过在 str.replace() 中添加 regex=True\u002FFalse 来修复 Pandas 的 FutureWarning","2021-07-01T16:53:52",{"id":168,"version":169,"summary_zh":170,"released_at":171},163373,"1.0.9","修复词云问题 #33  \n修复问题 #22","2020-07-06T20:32:28",{"id":173,"version":174,"summary_zh":175,"released_at":176},163374,"1.0.8","版本 1.0.8\n\n主要变更：\n\n- 新增 (named_entities)[https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fapi\u002Ftexthero.nlp.named_entities.html]\n- 新增 (noun_chunks)[https:\u002F\u002Ftexthero.org\u002Fdocs\u002Fapi\u002Ftexthero.nlp.noun_chunks]\n- 新增 remove_urls、replace_urls、remove_html_tags、remove_stopwords 和 replace_stopwords\n\n开发变更：\n- 为每个函数添加了基于 Sphinx + Docusaurus 的 API 文档\n- 改进了 docstring 文档\n- 提高了测试覆盖率，并开始使用 Travis CI 进行持续集成\n- 使用 black 而不是 yapf 来格式化代码\n","2020-06-01T15:55:37",{"id":178,"version":179,"summary_zh":180,"released_at":181},163375,"1.0.4","发布 V 1.0.4\n\n方法及其各自功能：\n\n预处理\n- `clean`\n\n表示\n- `do_tfidf`、`do_count`、`do_pca`、`do_nmf`、`do_kmeans`、`do_dbscan`\n\n可视化\n- `scatterplot`\n- `top_words`","2020-04-27T18:52:40"]