embeddings-backends
Select, adapt, and troubleshoot BERTopic embedding backends, precomputed embeddings, and multimodal image/text inputs.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
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 资源文件 3
- 参考文档references/api-reference.md6.2 KB
- 参考文档references/troubleshooting.md3.9 KB
- 参考文档references/workflows.md4.2 KB
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.
BaseEmbeddersubclasses, 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,
NotInstalledplaceholders, 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
- Start with
references/api-reference.mdfor backend classes, selection rules, shape expectations, and optional-placeholder behavior. - Use
references/workflows.mdfor explicit backend-selection paths, offline precomputed embeddings, custom backend construction, multimodal setup, and inventory checks. - Use
references/troubleshooting.mdfor install/import failures, placeholder errors, invalid shapes, wrong wrapper types, and download-related gotchas. - Run
scripts/inventory_backends.pyto 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=Noneand pass the matrix throughfit_transform(..., embeddings=...)ortransform(..., 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
WordDocEmbedderor a customBaseEmbedder. - If the task includes images, use
MultiModalBackendor a custom backend that definesembed_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=Noneand no downloads. - Optional-backend inventory: a report that distinguishes present modules, missing extras, and
NotInstalledplaceholders without instantiating remote models.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.