adaptive-classifier
БесплатноБез исполняемых скриптовНе проверенBuild, update and honestly evaluate text classifiers with the open-source adaptive-classifier library, which learns new examples and new classes without…
от sandeep85das287 установок в других каталогахОб этом скилле
Use this skill when the user wants a text classifier (https://github.com/codelion/adaptive-classifier) that starts from a few labeled examples and keeps learning. Everything runs locally. Do not call push_to_hub or any publish step unless the user explicitly asks.
Ask before anything downloads model weights or datasets. Creating AdaptiveClassifier(...) with a model name, from_pretrained(...) and ONNX export all fetch or write model files. Say which model and roughly why, and wait for a yes.
1. Is it a fit?
Good fit:
- Small labeled sets (tens to a few hundred examples per class).
- Labels that appear or change over time: new intents, new routing tiers, new policy categories.
- Routing, intent detection, moderation triage, ticket tagging, where you want to add examples without a retraining job.
Poor fit:
- A large, static, well-labeled dataset. Standard fine-tuning of an encoder will usually do better and is simpler to reason about.
- Tasks that need long-document understanding, generation, or labels that depend on subtle reasoning rather than text similarity.
Mechanism (from the source): texts are embedded by a pretrained encoder, per-class prototypes are kept in memory, and a small trainable head is blended with prototype similarity. Adding examples retrains the head briefly (10 epochs by default) with EWC protection for old classes.
2. Check the install
python -c "import adaptive_classifier; print(adaptive_classifier.__version__)"
If this fails, tell the user the library is missing and point them to the Installation section of the README. Do not run install commands or fetch code for them. The checks below were made against version 0.2.0; if the printed version differs, inspect signatures before relying on this skill:
python -c "import inspect, adaptive_classifier as a; print(inspect.signature(a.AdaptiveClassifier.__init__))"
3. Quickstart
from adaptive_classifier import AdaptiveClassifier
clf = AdaptiveClassifier("sentence-transformers/all-MiniLM-L6-v2") # downloads weights: ask first
clf.add_examples(texts, labels) # parallel lists of str; labels are str
print(clf.predict("some text", k=3)) # [(label, score), ...] sorted, top k (default 5)
batch = clf.predict_batch(list_of_texts, k=3, batch_size=32)
Notes verified in the source:
add_examplesraisesValueErroron empty lists or mismatched lengths.predictraises on empty text.- Encoder choice matters. The README says some models give poor embeddings for short inputs and suggests
bert-base-uncasedorsentence-transformers/all-MiniLM-L6-v2. Prefer an encoder trained for sentence similarity. - Pooling: since 0.2.0 the default
poolingisauto(the model's own sentence-transformers pooling if published, else mean). Options:"auto","mean","cls". Classifiers saved before 0.2.0 keep CLS pooling when reloaded. - Config is a plain dict:
AdaptiveClassifier(name, config={...}). Defaults checked:prototype_weight0.7,neural_weight0.3,new_class_example_threshold10,new_class_prototype_weight0.3,new_class_neural_weight0.7,max_examples_per_class1000,epochs10. Other constructor args:device,seed=42,use_onnx="auto",trust_remote_code=False(leave it False).
4. Add examples and new classes later
clf.add_examples(["Error 404 on login"], ["technical"]) # unseen label = new class
clf.add_examples(more_texts, more_labels) # more data for existing classes
print(clf.get_example_statistics()["examples_per_class"])
A label that has not been seen creates a new class: the head is expanded and trained with attention to the new class. A class with fewer than new_class_example_threshold trained examples leans on the head (0.3 prototype / 0.7 neural by default), so give new classes at least 10 examples before trusting them.
After any addition, re-run your held-out evaluation, because old classes can drift. Other tools: clear_memory(labels=None) drops stored examples (all, or the listed labels); merge_classifiers(other) merges another classifier with the same embedding size and retrains the head.
Order dependence: the README says example order can change predictions. For strict order independence set config={"prototype_weight": 1.0, "neural_weight": 0.0}, at some possible cost in accuracy (the README says "slightly lower"). Treat that as a claim to test on your data.
5. Multi-label
from adaptive_classifier import MultiLabelAdaptiveClassifier
m = MultiLabelAdaptiveClassifier(name, default_threshold=0.5, min_predictions=1, max_predictions=5)
m.add_examples(texts, [["a", "b"], ["b"]]) # list of label lists
m.predict_multilabel(text, threshold=None, max_labels=None)
m.get_label_statistics()
Thresholds are lowered automatically as the label count grows (README table: 0.5 for 2-4 labels down to 0.1 for 30+). Check precision per label after that adjustment.
6. Strategic (an
Установить adaptive-classifier в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл adaptive-classifier?
Build, update and honestly evaluate text classifiers with the open-source adaptive-classifier library, which learns new examples and new classes without retraining from scratch. Use for small labeled sets, label sets that change over time, and routing, intent or moderation tasks; not for large static datasets where standard fine-tuning is better.
Как установить скилл adaptive-classifier?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл adaptive-classifier запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic