bertopic
Route BERTopic topic modeling, embedding, vectorizer, labeling, visualization, and serialization workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- bertopic
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Route BERTopic topic modeling, embedding, vectorizer, labeling, visualization, and serialization workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/repo-provenance.md1.4 KB
- 参考文档references/repo-routing-metadata.json408 B
- 参考文档references/troubleshooting.md4.5 KB
- 参考文档references/workflows.md2.5 KB
- 脚本scripts/check_env.py6.7 KB
03 SKILL.md 正文
BERTopic
BERTopic turns documents, precomputed embeddings, or multimodal inputs into topic models you can fit, inspect, label, visualize, and save.
Install
python -m pip install bertopic
Use only the optional packages that the chosen workflow needs. For example, multimodal image workflows use bertopic[vision], while label and backend workflows may require openai, litellm, langchain, llama-cpp-python, spacy, fastembed, model2vec, gensim, flair, safetensors, or datamapplot.
If you are working from a local checkout to inspect the package, editable install is also fine:
python -m pip install -e .
Quick check
Run the bundled environment check first:
python scripts/check_env.py
Add --smoke for a tiny no-download fit/load-style smoke that uses synthetic documents and precomputed embeddings.
Route map
sub-skills/topic-modeling/— build BERTopic models, fit and transform data, runpartial_fit, mutate topics, and combine or reduce fitted models.sub-skills/embeddings-backends/— choose embedding backends, build custom embedders, inventory optional backend imports, and handle precomputed or multimodal embeddings.sub-skills/vectorizers-ctfidf/— tuneClassTfidfTransformer,CountVectorizer, andOnlineCountVectorizerfor better topic words.sub-skills/representations-labeling/— rerank keywords, generate labels, chain representation models, and manage multi-aspect topic outputs.sub-skills/analysis-visualization/— inspect fitted models with topic tables, hierarchies, distributions, and plots.sub-skills/serialization/— save, reload, and share fitted models locally or through the Hugging Face Hub.
When a task spans more than one route, start with the earliest route in the pipeline and move forward: embeddings → model building → topic-word tuning → labels → analysis → serialization.
Read next
references/workflows.mdfor the fastest route through common BERTopic tasks.references/troubleshooting.mdwhen imports, optional dependencies, plotting, or save/load fail.references/repo-provenance.mdbefore deciding whether this skill matches the current checkout.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).