Nlp Text Mining Expert logo

Nlp Text Mining Expert

Community
ptreezh
nlp-text-mining-expert

NLP Text Mining expert. Provides text preprocessing, entity extraction, topic modeling, sentiment analysis, and document classification using natural language processing techniques. Suitable for text analytics, information extraction, and NLP-based research.

Overview

Publisherptreezh
Repositorysscisubagent-skills
Skill namenlp-text-mining-expert
Stars
45
Forks
7
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ptreezh on GitHub. Read the source before you install it.

Installation

Install the Nlp Text Mining Expert AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ptreezh/sscisubagent-skills/tree/main/skills/nlp-text-mining-expert
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ptreezh/sscisubagent-skills.git /tmp/sscisubagent-skills
mkdir -p .claude/skills
cp -r /tmp/sscisubagent-skills/skills/nlp-text-mining-expert .claude/skills/nlp-text-mining-expert
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Nlp Text Mining Expert in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Nlp Text Mining Expert on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Nlp Text Mining Expert is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

---|------|------| | 清洗 | 去除HTML、特殊字符 | 正则表达式 | | 分词 | 中文: jieba, 英文: NLTK | jieba, spaCy | | 去停用词 | 移除无意义词 | 停用词表 | | 词性标注 | 标注词性 | jieba.posseg | | 词形还原 | 还原词根 | WordNet | | 标准化 | 大小写、繁简转换 | opencc |

中文分词示例

python
import jieba
import jieba.analyse

text = "自然语言处理是人工智能的重要分支"

# 基础分词
words = jieba.lcut(text)
# ['自然语言', '处理', '是', '人工智能', '的', '重要', '分支']

# 关键词提取
keywords = jieba.analyse.extract_tags(text, topK=5)
# ['自然语言', '人工智能', '处理', '重要', '分支']

特征提取

词袋模型(Bag of Words)

文档向量 = 词频向量

示例:
文档1: "我喜欢看电影"  → [1, 1, 1, 0, 0]
文档2: "我喜欢听音乐"  → [1, 1, 0, 1, 1]

词汇表: [我, 喜欢, 看电影, 听, 音乐]

TF-IDF

TF(t,d) = 词t在文档d中的频率
IDF(t) = log(总文档数 / 含词t的文档数)
TF-IDF = TF × IDF

作用: 降低常见词权重,提升区分性词权重

词向量(Word Embeddings)

模型特点维度
Word2Vec上下文预测100-300
GloVe全局共现100-300
BERT上下文感知768+
FastText子词信息100-300

主题建模

LDA (Latent Dirichlet Allocation)

假设:
- 文档是主题的混合
- 主题是词的分布

生成过程:
主题分布θ → 主题z → 词分布φ → 词w

参数:
K: 主题数量
α: 文档-主题先验
β: 主题-词先验

主题评估

指标含义原则
困惑度模型预测能力越低越好
一致性主题词相关度越高越好
主题数K值选择困惑度拐点

Python实现

python
from gensim import corpora, models

# 创建词典和语料
dictionary = corpora.Dictionary(texts)
corpus = [dictionary.doc2bow(text) for text in texts]

# 训练LDA
lda = models.LdaModel(
    corpus, 
    num_topics=10, 
    id2word=dictionary,
    passes=10
)

# 查看主题
for idx, topic in lda.print_topics():
    print(f"主题{idx}: {topic}")

情感分析

方法对比

方法优点缺点
词典方法简单、可解释覆盖有限
机器学习可定制需标注数据
深度学习效果好计算量大
预训练模型即用、效果好黑箱

情感词典

中文情感词典:
- HowNet情感词典
- 大连理工情感词典
- 清华大学中文褒贬义词典
- BosonNLP情感词典

情感得分计算:
Score = Σ(sentiment_word) / 词数

BERT情感分析

python
from transformers import pipeline

# 加载预训练模型
classifier = pipeline("sentiment-analysis", 
                      model="bert-base-chinese")

# 情感预测
result = classifier("这家餐厅的菜品非常好吃!")
# [{'label': 'POSITIVE', 'score': 0.99}]

命名实体识别(NER)

实体类型

类型示例
人名(PER)张三、李四
地名(LOC)北京、上海
机构名(ORG)北京大学、腾讯
时间(TIME)2024年3月
数值(NUM)100万、50%

spaCy实现

python
import spacy

nlp = spacy.load("zh_core_web_sm")
doc = nlp("张三在北京大学学习")

for ent in doc.ents:
    print(f"{ent.text}: {ent.label_}")
# 张三: PERSON
# 北京大学: ORG

文本分类

分类流程

标注数据
    │
    ↓
文本预处理
    │
    ↓
特征提取(TF-IDF/BERT)
    │
    ↓
模型训练
├── 传统: NB, SVM, RF
└── 深度: CNN, LSTM, BERT
    │
    ↓
模型评估
├── 准确率
├── 精确率/召回率
└── F1分数

评估指标

准确率(Accuracy) = 正确预测数 / 总预测数
精确率(Precision) = TP / (TP + FP)
召回率(Recall) = TP / (TP + FN)
F1 = 2 × P × R / (P + R)

可视化方法

方法用途
词云词频展示
主题词分布主题理解
情感趋势图时间序列情感
网络图词语共现
热力图文档-主题分布

使用示例

用户: 分析这批社交媒体评论的主题和情感

AI: 我将执行完整的文本分析流程:

## 数据概况
- 评论数: 10,000条
- 时间范围: 2024年1月-3月
- 来源: 微博、小红书

## 主题建模(LDA)
主题1(32%): 产品质量
  - 质量, 差, 假货, 劣质
主题2(28%): 物流服务  
  - 快递, 慢, 丢件, 态度
主题3(22%): 价格优惠
  - 便宜, 优惠, 活动, 性价比
主题4(18%): 客服体验
  - 客服, 回复, 解决, 推诿

## 情感分析
- 正面评论: 35%
- 负面评论: 45%
- 中性评论: 20%

## 洞察提取
1. 物流服务是主要痛点(负面占比62%)
2. 价格促销带来正面情感
3. 客服体验需要改善

🚫 绝对禁止原则

使用前必读:以下原则是不可逾越的红线,违反将导致NLP文本挖掘结论无效。

  1. 禁止不处理类别不平衡 — 正面:负面=1:9时直接训练模型,导致少数类召回率接近零
  2. 禁止脱离语境的词汇统计 — 仅统计词频而不考虑上下文语义,导致误解词语真实含义
  3. 禁止混淆准确率与有效性 — 高准确率可能来自类别不平衡,而非模型真正有效
  4. 禁止忽视文本预处理质量 — 分词错误、停用词表不匹配领域,直接影响后续分析可靠性
  5. 禁止不检验模型泛化能力 — 用训练集评估模型后直接应用,忽视过拟合和数据漂移风险
  6. 禁止脱离标注质量的模型评估 — 标注数据本身有偏(如标注者间信度低),则模型评估结果不可信

✅ 质量标准

完整性

  • 必做项清单完成度 ≥ 90%
  • 文本预处理步骤记录完整
  • 类别分布说明清晰

方法论

  • 理论框架与数据一致性 ≥ 90%
  • 分析步骤可复现性高(含预处理参数)
  • 模型选择有据可查

深度

  • 核心维度覆盖 ≥ 80%
  • 类别不平衡处理方案说明
  • 模型可解释性分析

🖥️ Python 工具

工具链

#工具名称功能描述
1text_preprocessor.py文本预处理,支持分词、去停用词、词形还原、繁简转换(跨平台)
2topic_modeler.py主题建模,支持LDA、BERTopic、 coherence score计算
3sentiment_analyzer.py情感分析,支持词典方法、机器学习、深度学习多方法对比
4ner_extractor.py命名实体识别,支持多语言NER、实体类型自定义

CLI用法

bash
python tools/text_preprocessor.py --input raw_text.txt --output cleaned.txt --lang zh
python tools/topic_modeler.py --input corpus.txt --method lda --num-topics 10 --output topics.json
python tools/sentiment_analyzer.py --input reviews.csv --method bert --output sentiment.json

CLI用法

bash
# NLP文本挖掘推荐使用jieba、gensim、transformers等库
python -c "import jieba; print(list(jieba.cut('自然语言处理')))"

参考文献

  1. Jurafsky, D., & Martin, J.H. (2024). Speech and Language Processing. 3rd ed.
  2. Bird, S., Klein, E., & Loper, E. (2009). Natural Language Processing with Python.
  3. Blei, D.M. (2012). Probabilistic topic models. CACM, 55, 77-84.
  4. Devlin, J., et al. (2019). BERT: Pre-training of deep bidirectional transformers.

技能版本: 5.0.0
方法论标准: Jurafsky & Martin (2024)
创建时间: 2026-03-15

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Nlp Text Mining Expert AI skill do?

NLP Text Mining expert. Provides text preprocessing, entity extraction, topic modeling, sentiment analysis, and document classification using natural language processing techniques. Suitable for text analytics, information extraction, and NLP-based research.

Why use Nlp Text Mining Expert on TypingMind?

Because you install it once and use it with any model. Nlp Text Mining Expert is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Nlp Text Mining Expert in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ptreezh/sscisubagent-skills/tree/main/skills/nlp-text-mining-expert. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Nlp Text Mining Expert?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Nlp Text Mining Expert?

As many as you like. As long as a model supports skills, you can use Nlp Text Mining Expert with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Nlp Text Mining Expert AI skill free?

Yes. It is published on GitHub by ptreezh under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇