인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
개발 및 엔지니어링 · SKILL.md

sentence-transformers

sentence-transformers

Use Sentence Transformers for dense embeddings, semantic search, CrossEncoder reranking, SparseEncoder search, evaluation/training planning, and ONNX/OpenVINO backend optimization. Routes natural language tasks to focused sub-skills with bundled references and safe helper scripts.

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: sentence-transformers description: "Use Sentence Transformers for dense embeddings, semantic search, CrossEncoder reranking, SparseEncoder search, evaluation/training planning, and ONNX/OpenVINO backend optimization. Routes natural language tasks to focused sub-skills with bundled references and safe helper scripts." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

Sentence Transformers

Use this repo skill when a task involves the sentence-transformers package for embeddings, retrieval, reranking, sparse search, evaluation, fine-tuning plans, or inference backend optimization.

This root file is a router. Open the matching sub-skill and its linked references before writing code, recommending APIs, or diagnosing failures.

Install and Verify

Use the smallest public install that matches the task:

pip install -U sentence-transformers
python - <<'PY'
import sentence_transformers
from sentence_transformers import SentenceTransformer, CrossEncoder, SparseEncoder
print(sentence_transformers.__version__)
print(SentenceTransformer.__name__, CrossEncoder.__name__, SparseEncoder.__name__)
PY

Optional extras are task-specific:

  • Multimodal inputs: pip install -U "sentence-transformers[image]", [audio], or [video].
  • Training: pip install -U "sentence-transformers[train]"; add trackers such as trackio or wandb only when needed.
  • ONNX: pip install -U "sentence-transformers[onnx]" for CPU or [onnx-gpu] for GPU providers.
  • OpenVINO: pip install -U "sentence-transformers[openvino]".

Route by Task

User requestOpen this sub-skillWhy
Compute dense embeddings, similarity scores, encode_query, encode_document, prompts, truncation, precision, multimodal inputssub-skills/embeddings-and-similarity/SKILL.mdOwns SentenceTransformer inference and output validation
Build semantic search over embeddings, retrieve then rerank, hard-negative mining, quantized embedding search, similarity helperssub-skills/retrieval-and-utilities/SKILL.mdOwns sentence_transformers.util retrieval utilities and orchestration
Score text pairs or rerank a candidate list with CrossEncoder.predict or CrossEncoder.ranksub-skills/reranking-cross-encoder/SKILL.mdOwns reranker APIs, pair/list shapes, and activation/softmax pitfalls
Generate sparse embeddings, SPLADE-style search, sparse IR evaluation, sparse service integrationsub-skills/sparse-encoder-search/SKILL.mdOwns SparseEncoder, sparse vectors, active dims, and sparse-specific troubleshooting
Choose losses, evaluators, trainers, dataset shapes, samplers, smoke-test training planssub-skills/evaluation-and-training/SKILL.mdOwns training/evaluation planning across all three model families
Use backend="onnx" or backend="openvino", optimize or quantize exported model artifactssub-skills/backend-export-optimization/SKILL.mdOwns backend extras, provider/file-name options, and export diagnostics

Common Decision Points

  • Choose SentenceTransformer for first-stage retrieval, semantic similarity, clustering, classification via embeddings, and embedding precomputation.
  • Choose CrossEncoder when scoring (query, document) pairs jointly is acceptable and reranking quality matters more than throughput.
  • Choose SparseEncoder for learned sparse retrieval, lexical expansion, inverted-index-friendly scores, and SPLADE-style workflows.
  • Use dense retrieval plus CrossEncoder reranking for high-quality search: retrieve top-k with embeddings, preserve corpus_id, then rerank selected texts.
  • Keep optional services explicit. FAISS, USearch, Elasticsearch, OpenSearch, Qdrant, Seismic, ONNX Runtime, and OpenVINO require their own extras, packages, or running services.

Bundled Checks

Run these safe helper scripts from inside this skill directory or pass an explicit script path from any project:

python sub-skills/retrieval-and-utilities/scripts/semantic_search_demo.py --toy-tensors
python sub-skills/backend-export-optimization/scripts/backend_export_check.py --signatures
python sub-skills/evaluation-and-training/scripts/training_plan_check.py --help

Model-loading smoke scripts intentionally require an explicit --model; they do not silently download a checkpoint by default.

Troubleshooting First Reads

  • Package install, optional extras, and broad workflow failures: references/troubleshooting.md.
  • Source freshness and evidence baseline: references/repo-provenance.md.
  • Workflow-specific failures: open the nearest sub-skill references/troubleshooting.md.

Boundaries

  • This skill is for using the public package and its documented APIs, not for maintainer release automation or documentation builds.
  • Do not assume large models, Hub downloads, external vector databases, or GPU backends are available unless the user says so or the environment proves it.
  • Do not run training, model export, service integration, or native examples as a smoke test unless the user explicitly requests those side effects and prerequisites are present.
저장한 Skills