ml-nlp
Use when the user asks about NLP pipelines with spaCy or Hugging Face Transformers: tokenization, NER, text classification, sentiment, summarization, QA, or…
от j4flmao★ 47 звёзд на GitHub
Установить ml-nlp в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
ML NLP
Quick Start
from transformers import pipeline
classifier = pipeline("sentiment-analysis")
result = classifier("I loved this movie!")
print(result)
Purpose
Design NLP pipelines for text processing and transformer-based models with appropriate framework selection, model architecture, fine-tuning strategy, and inference setup.
Architecture/Decision Trees
Model Architecture Selection
NLP task type
├── Understanding tasks (classify, tag, extract)
│ ├── Text classification, sentiment → BERT, RoBERTa, DeBERTa
│ ├── NER, POS tagging → BERT, RoBERTa + CRF head
│ ├── Extractive QA → BERT, RoBERTa, ALBERT
│ ├── Sentence similarity → SBERT, RoBERTa (SentenceTransformers)
│ └── Few-shot classification → SetFit (sentence transformers + logistic)
├── Generation tasks (generate, summarize, translate)
│ ├── Summarization → BART, T5, Pegasus
│ ├── Translation → MarianMT, NLLB-200, mT5
│ ├── Generic generation → GPT-2, Llama, Mistral
│ └── Code generation → CodeLlama, StarCoder
└── Sequence-to-sequence
├── Table-to-text → T5, BART
├── Grammar correction → T5, BART
└── Dialogue → T5, FLAN-T5
Model Size Selection
Dataset size and accuracy needs
├── Classification / NER
│ ├── <1K examples → DistilBERT / ALBERT (small, less overfitting)
│ ├── 1K-10K → BERT-base / RoBERTa-base
│ ├── 10K-100K → RoBERTa-large / DeBERTa-base
│ └── >100K → DeBERTa-large / ELECTRA
├── Summarization / Translation
│ ├── <10K → BART-base / T5-small (smaller models generalize better)
│ ├── 10K-100K → BART-large / T5-base
│ └── >100K → Pegasus / T5-large / NLLB
└── LLM (>1B params)
├── <10K examples → LoRA with 7B model (QLoRA for single GPU)
├── 10K-100K → LoRA with 13B-70B model
└── >100K → Full fine-tune 7B-13B model
Fine-Tuning Strategy Decision Tree
Compute budget (GPU memory)
├── <12GB (consumer GPU: RTX 3060, 2080)
│ ├── <1B model → Full fine-tune (batch_size=8, grad_accum=4)
│ ├── 1-7B model → QLoRA (4-bit quantization + LoRA)
│ └── >7B model → QLoRA with gradient checkpointing
├── 12-24GB (RTX 3090, 4080)
│ ├── <3B model → Full fine-tune or LoRA
│ ├── 3-13B model → LoRA / QLoRA (8-bit)
│ └── >13B model → QLoRA (4-bit)
├── 24-48GB (A10G, A100 40GB)
│ ├── <7B model → Full fine-tune
│ ├── 7-13B model → LoRA (full precision) or full fine-tune with FSDP
│ └── >13B model → LoRA / QLoRA
└── >48GB (A100 80GB, H100)
├── <13B model → Full fine-tune with FSDP
├── 13-70B → FSDP / DeepSpeed ZeRO-3
└── >70B → DeepSpeed ZeRO-3 + CPU offloading
Agent Protocol
Trigger
User request includes: NLP, natural language processing, NLTK, spaCy, HuggingFace, BERT, text classification, NER, sentiment analysis, summarization, tokenization, embedding, transformer, fine-tuning.
Input Context
Before activating, verify:
- NLP task type (classification, NER, sentiment, summarization, QA, translation, generation).
- Language(s) involved (monolingual, multilingual, low-resource).
- Dataset size for fine-tuning (few-shot, hundreds, thousands, millions).
- Deployment constraints (latency, throughput, memory, device).
- Budget for compute (CPU inference, GPU fine-tuning, cloud TPU).
Output Artifact
NLP pipeline with framework selection, model choice, training strategy, inference setup.
Response Format
## NLP Pipeline
### Task
{classification / NER / sentiment / summarization / QA / translation / generation}
Model: {model_name} | Size: {base / large / xl}
### Preprocessing
Tokenization: {wordpiece / BPE / sentencepiece}
Max Length: {N} | Truncation: {left / right}
### Training
Strategy: {full / LoRA / prefix tuning / adapter}
Learning Rate: {value} | Schedule: {linear / cosine}
Precision: {fp32 / fp16 / bf16}
No preamble. No postamble. No explanations. No filler. Compress output.
Completion Criteria
- Task and language identified with appropriate framework.
- Preprocessing pipeline defined (tokenization, normalization, max length).
- Model architecture selected by task and compute budget.
- Fine-tuning strategy matched to compute budget.
- Evaluation metrics selected for the task (F1, BLEU, ROUGE, perplexity).
- Inference optimization configured (quantization, ONNX, batching).
Workflow
Step 1: Task & Framework Selection
Text classification: HuggingFace Transformers (BERT, RoBERTa). Production: spaCy with transformer wrapper. NER: spaCy (production pipeline, entity merging). Summarization: BART (best quality-size), T5 (flexible), Pegasus (SOTA). QA: BERT (extractive), T5/BART (generative). Translation: MarianMT (per-language pairs), NLLB-200 (many languages).
# Framework comparison
def select_framework(task, production=False, latency_sensitive=False):
if task in ["classification", "sentiment"]:
return "spacy" if production else "transformers"
eli
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/huggingface-transformers.md
- references/nlp-advanced.md
- references/nlp-fundamentals.md
- references/nlp-model-training.md
- references/nlp-pipeline.md
- references/nlp-production.md
- references/prompt-engineering.md
- references/text-processing.md
FAQ
Что делает скилл ml-nlp?
Use when the user asks about NLP pipelines with spaCy or Hugging Face Transformers: tokenization, NER, text classification, sentiment, summarization, QA, or fine-tuning BERT-style models with Trainer. Produces pipeline design, model choice and fine-tuning code. Not for LLM chat fine-tuning with LoRA (use llm-finetuning) or RAG (use llm-rag-retrieval-internals).
Как установить скилл ml-nlp?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ml-nlp запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…