技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
evaluation-and-training【数据与研究】Route sentence-transformers evaluation and training tasks across SentenceTransformer, CrossEncoder, and SparseEncoder trainers, losses, evaluators, dataset shapes, samplers, smoke tests, and safe training scaffolding.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task asks how to evaluate, fine-tune, smoke-test, or debug training for SentenceTransformer, CrossEncoder, or SparseEncoder models.
Keep this file as the router. Open the references before writing code or giving final training advice.
| Request | Read first | Use for |
|---|---|---|
| Build a safe training workflow | references/training-reference.md | Trainer classes, training args, datasets, samplers, model cards, baseline eval, smoke tests |
Pick evaluator or metric_for_best_model | references/evaluation-reference.md | Evaluator families, primary metric keys, baseline/final eval practice |
| Match data shape to loss | references/loss-routing.md | Dense, reranker, sparse, distillation, pair/list/triplet routing |
| Diagnose failures | references/troubleshooting.md | Install extras, API misuse, metrics, samplers, optional backends/services |
| Validate a proposed plan without training | scripts/training_plan_check.py | Static checks for model type, data shape, loss, evaluator, sampler, and extras |
SentenceTransformerTrainer for dense bi-encoders: retrieval embeddings, STS, clustering, paraphrase mining, distillation, Matryoshka, static embeddings, and most vector-search fine-tuning.CrossEncoderTrainer for rerankers or pair classifiers: pair scoring, top-K reranking, NLI-style classification, BCE/ranking/listwise reranker losses.SparseEncoderTrainer for SPLADE-style learned sparse retrieval: sparse vectors, inverted-index retrieval, FLOPS regularization, sparse/distillation losses.pip install "sentence-transformers[train]"; add image, audio, or video extras only for multimodal data.datasets.Dataset or DatasetDict; label columns must be named label, labels, score, or scores; other columns are inputs and their order matters.trainer.train() to record a baseline, then compare final or best-checkpoint metrics against it.batch_sampler=BatchSamplers.NO_DUPLICATES; for batch triplet losses, use BatchSamplers.GROUP_BY_LABEL.multi_dataset_batch_sampler=MultiDatasetBatchSamplers.PROPORTIONAL or ROUND_ROBIN deliberately.max_steps=1 before committing GPU time.Run the bundled checker to catch common plan mismatches before writing a full script:
python sub-skills/evaluation-and-training/scripts/training_plan_check.py \
--model-type cross-encoder \
--data-shape pair-binary \
--loss BinaryCrossEntropyLoss \
--evaluator CrossEncoderRerankingEvaluator
The checker is static and does not import or train sentence-transformers; it validates routing assumptions and prints warnings to carry into the real script.