AGENT SKILL

embeddings-backends

Select, adapt, and troubleshoot BERTopic embedding backends, precomputed embeddings, and multimodal image/text inputs.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
embeddings-backends
license
MIT
metadata
{ "package": "BERTopic", "disco-role": "operating", "parent-skill": "bertopic", "package-version": "0.17.4" }
description
Select, adapt, and troubleshoot BERTopic embedding backends, precomputed embeddings, and multimodal image/text inputs.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

embeddings-backends

Use this sub-skill when the task is about BERTopic embedding selection or backend adaptation rather than topic representations or c-TF-IDF.

Route here for

  • embedding_model= choices, select_backend(...), and language-driven defaults.
  • Sentence Transformers, Hugging Face feature-extraction pipelines, Model2Vec, Flair, spaCy, USE, Gensim, scikit-learn pipelines, OpenAI, Cohere, FastEmbed, LangChain, and MultiModal wrappers.
  • BaseEmbedder subclasses, custom embedding classes, document/word backend composition, and deterministic offline embedders.
  • Precomputed embeddings passed to fit_transform(...), transform(...), or tiny synthetic smoke checks.
  • Multimodal text + image embeddings, embed_images(...), and image/document alignment.
  • Optional dependency detection, NotInstalled placeholders, and safe backend inventory checks.

Route elsewhere

  • Topic labels, KeyBERT-inspired/MMR/POS/LLM aspects, or topic_aspects_: use the representations-labeling sub-skill.
  • c-TF-IDF, CountVectorizer tuning, online vocabulary updates, or update_topics(...) term refreshes: use the vectorizers-ctfidf sub-skill.
  • Plotting, hierarchy analysis, topic distributions, or dashboards: use the analysis-visualization sub-skill.
  • Save/load, format selection, or hub upload: use the serialization sub-skill.

Operating references

  1. Start with references/api-reference.md for backend classes, selection rules, shape expectations, and optional-placeholder behavior.
  2. Use references/workflows.md for explicit backend-selection paths, offline precomputed embeddings, custom backend construction, multimodal setup, and inventory checks.
  3. Use references/troubleshooting.md for install/import failures, placeholder errors, invalid shapes, wrong wrapper types, and download-related gotchas.
  4. Run scripts/inventory_backends.py to inventory available backends without downloads and to smoke-test a tiny deterministic local encoder.

Minimal decision flow

  • If you already have embeddings or need a no-download path, keep embedding_model=None and pass the matrix through fit_transform(..., embeddings=...) or transform(..., embeddings=...).
  • If you want BERTopic to choose a default backend, set language= only when no explicit embedding model is being passed; otherwise provide the backend directly.
  • If you need one backend for documents and another for topic words, use WordDocEmbedder or a custom BaseEmbedder.
  • If the task includes images, use MultiModalBackend or a custom backend that defines embed_images(...); keep image/document rows aligned.
  • If the backend selection must stay offline, avoid string model IDs because they can still trigger downloads.
  • If you only need to know what is installed, use the bundled inventory script instead of probing by downloading models.

Verification anchors for future checks

  • Deterministic local custom backend: a tiny function-backed encoder that always returns the same (n, d) matrix for the same input.
  • Precomputed embedding smoke: a small document list with a hand-built dense embedding matrix and explicit topic labels, fitted with embedding_model=None and no downloads.
  • Optional-backend inventory: a report that distinguishes present modules, missing extras, and NotInstalled placeholders without instantiating remote models.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351