home / skills / 404kidwiz / claude-supercode-skills / nlp-engineer-skill

nlp-engineer-skill skill

/nlp-engineer-skill

This skill helps you design and implement NLP pipelines for text classification, NER, sentiment analysis, and LLM integration using Hugging Face and spaCy.

npx playbooks add skill 404kidwiz/claude-supercode-skills --skill nlp-engineer-skill

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.3 KB
---
name: nlp-engineer
description: Expert in Natural Language Processing, designing systems for text classification, NER, translation, and LLM integration using Hugging Face, spaCy, and LangChain. Use when building NLP pipelines, text analysis, or LLM-powered features. Triggers include "NLP", "text classification", "NER", "named entity", "sentiment analysis", "spaCy", "Hugging Face", "transformers".
---

# NLP Engineer

## Purpose
Provides expertise in Natural Language Processing systems design and implementation. Specializes in text classification, named entity recognition, sentiment analysis, and integrating modern LLMs using frameworks like Hugging Face, spaCy, and LangChain.

## When to Use
- Building text classification systems
- Implementing named entity recognition (NER)
- Creating sentiment analysis pipelines
- Fine-tuning transformer models
- Designing LLM-powered features
- Implementing text preprocessing pipelines
- Building search and retrieval systems
- Creating text generation applications

## Quick Start
**Invoke this skill when:**
- Building NLP pipelines (classification, NER, sentiment)
- Fine-tuning transformer models
- Implementing text preprocessing
- Integrating LLMs for text tasks
- Designing semantic search systems

**Do NOT invoke when:**
- RAG architecture design → use `/ai-engineer`
- LLM prompt optimization → use `/prompt-engineer`
- ML model deployment → use `/mlops-engineer`
- General data processing → use `/data-engineer`

## Decision Framework
```
NLP Task Type?
├── Classification
│   ├── Simple → Fine-tuned BERT/DistilBERT
│   └── Zero-shot → LLM with prompting
├── NER
│   ├── Standard entities → spaCy
│   └── Custom entities → Fine-tuned model
├── Generation
│   └── LLM (GPT, Claude, Llama)
└── Semantic Search
    └── Embeddings + Vector store
```

## Core Workflows

### 1. Text Classification Pipeline
1. Collect and label training data
2. Preprocess text (tokenization, cleaning)
3. Select base model (BERT, RoBERTa)
4. Fine-tune on labeled dataset
5. Evaluate with appropriate metrics
6. Deploy with inference optimization

### 2. NER System
1. Define entity types for domain
2. Create labeled training data
3. Choose framework (spaCy, Hugging Face)
4. Train custom NER model
5. Evaluate precision, recall, F1
6. Integrate with post-processing rules

### 3. Embedding-Based Search
1. Select embedding model (sentence-transformers)
2. Generate embeddings for corpus
3. Index in vector database
4. Implement query embedding
5. Add hybrid search (keyword + semantic)
6. Tune similarity thresholds

## Best Practices
- Start with pretrained models, fine-tune as needed
- Use domain-specific preprocessing
- Evaluate with task-appropriate metrics
- Consider inference latency for production
- Implement proper text cleaning pipelines
- Use batching for efficient inference

## Anti-Patterns
| Anti-Pattern | Problem | Correct Approach |
|--------------|---------|------------------|
| Training from scratch | Wastes data and compute | Fine-tune pretrained |
| No preprocessing | Noisy inputs hurt performance | Clean and normalize text |
| Wrong metrics | Misleading evaluation | Task-appropriate metrics |
| Ignoring class imbalance | Biased predictions | Balance or weight classes |
| Overfitting to eval set | Poor generalization | Proper train/val/test splits |

Overview

This skill provides expert guidance for designing and implementing Natural Language Processing systems. It focuses on practical solutions for text classification, named entity recognition, sentiment analysis, embedding search, and LLM integration using tools like Hugging Face, spaCy, and LangChain. Use it to accelerate building reliable, production-ready NLP pipelines.

How this skill works

The skill inspects the NLP task type, recommended architectures, and practical workflows, then presents concrete steps: data collection and preprocessing, model selection (pretrained vs fine-tune), evaluation metrics, and deployment considerations. It maps tasks to frameworks (spaCy for NER, transformers for classification and fine-tuning, sentence-transformers for embeddings) and outlines integration patterns for LLMs and vector search.

When to use it

  • Building or improving text classification pipelines
  • Implementing named entity recognition, including custom NER
  • Creating sentiment analysis or other text-labeling systems
  • Fine-tuning transformer models for domain-specific tasks
  • Designing semantic search or retrieval using embeddings and vector stores
  • Integrating LLMs for generation, zero-shot classification, or RAG features

Best practices

  • Start from pretrained models and fine-tune rather than training from scratch
  • Apply domain-specific preprocessing and consistent tokenization
  • Choose evaluation metrics that match the task (accuracy, F1, precision/recall, MAP for retrieval)
  • Address class imbalance via sampling, reweighting, or data augmentation
  • Measure and optimize inference latency; use batching, quantization or distillation for production
  • Combine semantic embeddings with keyword hybrid search to improve relevance

Example use cases

  • Fine-tune a BERT variant for multi-class support ticket categorization
  • Train a custom spaCy NER model to extract product attributes from reviews
  • Build a semantic search over documentation using sentence-transformers and a vector database
  • Implement sentiment analysis pipeline for social media monitoring with streaming preprocessing
  • Integrate an LLM with LangChain for contextual generation and zero-shot classification

FAQ

Should I always fine-tune a model for best results?

No. Start with pretrained models and evaluate. Fine-tune when domain shift or task performance requires it; use few-shot or prompt-based LLMs for low-data cases.

When to use spaCy vs Hugging Face?

Use spaCy for fast, production-ready NER and rule-based pipelines. Use Hugging Face transformers for fine-tuning large models, complex classification, and tasks needing transformer architectures.