Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

algo-nlp-lda算法 NLP LDA

Agent Skill

algo-nlp-lda 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

353

周安装

15

GitHub Stars

125

下载量

124
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:algo-nlp-lda(算法 NLP LDA)
来源仓库:https://github.com/asgard-ai-platform/skills
仓库路径:skills/algo-nlp-lda
安装命令:
npx skills add https://github.com/asgard-ai-platform/skills --skill algo-nlp-lda
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/asgard-ai-platform/skills --skill algo-nlp-lda

简介

algo-nlp-lda 实现 LDA 主题建模,从文档集合中自动挖掘 K 个潜在语义主题。

  • 适用于无监督文本探索、新闻分类或知识库自动归类等场景,无需预先标注。
  • 基于吉布斯采样或变分推断,复杂度随词 token 数量与迭代次数线性增长。
  • 安装方式:GitHub 仓库;建议预处理停用词并调整主题数以匹配实际语义粒度。
  • 注意:若类别已知,直接使用监督分类更准确;主题可解释性依赖于词汇分布清晰度。

SKILL.md

LDA Topic Modeling

Overview

Latent Dirichlet Allocation models each document as a mixture of topics and each topic as a distribution over words. Discovers K latent topics from a corpus without supervision. Uses Gibbs sampling or variational inference. Complexity: O(N × K × iterations) where N = total word tokens.

When to Use

Trigger conditions:

  • Discovering latent themes in a large document collection
  • Organizing/categorizing documents by automatically discovered topics
  • Exploratory text analysis when categories are unknown

When NOT to use:

  • When categories are known (use supervised classification)
  • For short texts (tweets, titles) — too few words per document for reliable topic assignment
  • When you need semantic understanding (use embeddings)

Algorithm

IRON LAW: The Number of Topics K Must Be Chosen, Not Discovered
LDA does NOT tell you how many topics exist. K is a hyperparameter.
Too few topics: overly broad, mixed themes. Too many: fragmented,
redundant topics. Use coherence score (C_v) to compare K values,
but the final choice requires human judgment on topic interpretability.

Phase 1: Input Validation

Preprocess: tokenize, remove stop words, apply lemmatization. Build document-term matrix. Filter: remove terms appearing in <5 or >50% of documents. Gate: Clean DTM, vocabulary size reasonable (1K-50K terms).

Phase 2: Core Algorithm

  1. Choose K (start with √(N/2), try range K=5,10,15,20,...)
  2. Set hyperparameters: α = 50/K (document-topic density), β = 0.01 (topic-word density)
  3. Run LDA (Gibbs sampling: 1000+ iterations, or variational inference)
  4. Extract: topic-word distributions (top 10-20 words per topic) and document-topic distributions

Phase 3: Verification

Evaluate: topic coherence (C_v score, higher is better), manual inspection of top words per topic, check for "junk" topics (mixed incoherent words). Gate: Coherence score acceptable, topics are humanly interpretable.

Phase 4: Output

Return topics with top words and document assignments.

Output Format

{
  "topics": [{"id": 0, "label": "finance", "top_words": ["revenue", "profit", "quarter", "growth"], "coherence": 0.55}],
  "doc_topics": [{"doc_id": "d1", "dominant_topic": 0, "topic_distribution": [0.7, 0.1, 0.2]}],
  "metadata": {"K": 10, "coherence_avg": 0.48, "documents": 5000, "vocabulary": 8000}
}

Examples

Sample I/O

Input: 1000 news articles, K=5 Expected: Topics like: {politics, sports, technology, business, entertainment} with coherent top words per topic.

Edge Cases

InputExpectedWhy
Very short documentsPoor topic assignmentToo few words for reliable mixture estimation
Homogeneous corpus1-2 topics dominateAll documents are similar, limited topic diversity
K=1Single topic = corpus vocabularyDegenerate case, no discrimination

Gotchas

  • Stop words MUST be removed: LDA will create "junk" topics dominated by common words ("the", "is", "and") if stop words remain.
  • Topic labeling is manual: LDA gives word distributions, NOT topic names. You must interpret and label topics based on top words.
  • Reproducibility: Gibbs sampling is stochastic. Different random seeds give different topics. Run multiple times and check stability.
  • Dynamic topics: Standard LDA assumes topics are static. For evolving corpora (news over years), use Dynamic Topic Models.
  • Hyperparameter sensitivity: Low α produces documents with fewer, more distinct topics. Low β produces topics with fewer, more specific words. Tune or use automatic methods.

References

  • For coherence metrics and K selection, see references/topic-evaluation.md
  • For dynamic and correlated topic models, see references/advanced-lda.md

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.13%
按下载量换算41

Claude

29.3%
按下载量换算36

Cursor

20.04%
按下载量换算25

Gemini CLI

9.47%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills