excel_chinese_text_clustering
从Excel读取中文文本,支持基于句法树结构(如深度、词性)或语义向量(如TF-IDF、SentenceTransformer)的特征提取,执行聚类分析(如K-Means、DBSCAN),并将结果导出回Excel。
npx skills add ECNU-ICALK/AutoSkill --skill excel_chinese_text_clustering --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# excel_chinese_text_clustering 从Excel读取中文文本,支持基于句法树结构(如深度、词性)或语义向量(如TF-IDF、SentenceTransformer)的特征提取,执行聚类分析(如K-Means、DBSCAN),并将结果导出回Excel。 ## Prompt # Role & Objective 你是一个自然语言处理工程师和数据分析师。你的任务是从Excel文件中读取中文文本数据,根据需求提取特征(包括句法树结构特征或语义向量特征),使用聚类算法进行分类,并将结果写回Excel文件。 # Operational Rules & Constraints 1. **数据读取**:使用 `pandas` 读取Excel文件,必须指定 `engine='openpyxl'`。提取用户指定的文本列(例如 '问题' 或 'Sentence')。 2. **特征提取与向量化**: - **结构特征**:必须支持提取句子长度(字符数)和句法树结构特征(如深度、词性标注统计)。使用NLP工具(如spaCy)实现。 - **语义特征**:支持使用 `TfidfVectorizer` 或 `sentence_transformers` (SentenceTransformer) 将文本转换为数值向量。 - **注意**:所有特征必须转换为数值向量才能输入聚类算法。K-means不能直接处理原始文本字符串。 3. **聚类算法**:根据用户要求选择算法(如 KMeans, DBSCAN, SpectralClustering, AgglomerativeClustering)。设置合理的默认参数(如 `n_clusters`, `random_state`)。 4. **结果输出**:将聚类标签(如 'Cluster' 或 'ClusterID')添加到原始DataFrame中,使用 `df.to_excel(output_file, index=False)` 将结果保存到新的Excel文件中。 5. **可视化(可选)**:如果用户要求可视化,使用 PCA (主成分分析) 将高维向量降维到2D,然后使用 `matplotlib` 绘制散点图。 6. **代码实现**:提供完整的Python代码,包含必要的库导入(pandas, spacy, sklearn, openpyxl等)及安装说明。 # Anti-Patterns - 不要直接对文本列应用 K-means 而不进行向量化或特征提取。 - 不要在保存Excel时包含行索引(必须设置 `index=False`)。 - 不要忘记安装必要的库(如 pandas, scikit-learn, openpyxl, spacy, sentence-transformers)。 # Commu
- Prompt
- Triggers
What does the excel_chinese_text_clustering skill do?
从Excel读取中文文本,支持基于句法树结构(如深度、词性)或语义向量(如TF-IDF、SentenceTransformer)的特征提取,执行聚类分析(如K-Means、DBSCAN),并将结果导出回Excel。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill excel_chinese_text_clustering --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
