← All skills
Nlp Engineer
Use when NLP pipeline development with text processing, embeddings, classification, NER, and transformer fine-tuning
About this skill
Use when NLP pipeline development with text processing, embeddings, classification, NER, and transformer fine-tuning
SKILL.md
nlp-engineer.SKILL.mdPlace it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review the contents and run it in a controlled environment first.
--- name: Nlp Engineer description: Use when NLP pipeline development with text processing, embeddings, classification, NER, and transformer fine-tuning category: Data & AI version: 1.0.0 tools: [] --- # NLP Engineer Agent ## Core Principles - Not every NLP task needs a large language model. Regex, rule-based systems, and classical ML solve many text problems faster and cheaper. - Preprocessing determines model ceiling. Noisy text in means noisy predictions out. Invest in cleaning, normalization, and tokenization. - Domain-specific language requires domain-specific solutions. General-purpose models underperform on legal, medical, and technical text without adaptation. - Evaluate on realistic data. Clean, well-formatted test sets hide the failures you will see in production. ## Text Preprocessing - Normalize Unicode with . Handle encoding issues explicitly. - Use spaCy for tokenization, sentence segmentation, and linguistic analysis. It is faster than NLTK for production workloads. - Implement language detection with or before processing multilingual inputs. - Handle domain-specific artifacts: HTML tags, URLs, email addresses, code blocks, emoji, hashtags. - Use regex for pattern extraction (phone numbers, dates, IDs) before applying ML models. ## Text Classification - Use sentence-transformers with a linear classifier for few-shot classification (10-50 examples per class). - Use SetFit for efficient few-shot classification without prompt engineering: fine-tune a sentence transformer with contrastive learning. - Use Hugging Face with for full fine-tuning when you have 1000+ labeled examples. - Use multi-label classification with when documents can belong to multiple categories. - Balance classes with oversampling (SMOTE for embeddings), class weights, or focal loss. Never ignore class imbalance. ## Named Entity Recognition - Use spaCy NER for standard entities (PERSON, ORG, DATE, MONEY) with the model. - Train custom NER models with spaCy's for domain-specific entities (drug names, legal citations, product codes). - Use token classification with from Hugging Face for complex entity schemas. - Use IOB2 tagging format for training data. Validate tag sequences are valid (no I- without preceding B-). - Evaluate NER with entity-level F1 (strict and relaxed matching). Token-level metrics hide boundary errors. ## Embeddings and Similarity - Use sentence-transformers ( for speed, for quality) for semantic similarity. - Normalize embeddings to unit vectors for cosine similarity with dot product. - Use FAISS for efficient nearest neighbor search with IVF indexes for datasets exceeding 100K documents. - Implement dimensionality reduction with Matryoshka Representation Learning for adjustable embedding sizes. - Use cross-encoders for high-accuracy reranking of top-k results from bi-encoder retrieval. ## Information Extraction - Use dependency parsing for relation extraction: identify subject-verb-object triples from parsed sentences. - Use regex patterns anchored to entity types: extract amounts after currency entities, dates after temporal phrases. - Use structured extraction with LLMs only when rules cannot handle the variability. Define output schemas with Pydantic. - Implement coreference resolution with spaCy or neuralcoref for document-level entity linking. ## Evaluation - Use macro F1 for multi-class classification (treats all classes equally regardless of support). - Use span-level exact match and partial match for NER evaluation. Report per-entity-type metrics. - Use BERTScore or BLEURT for text generation quality. BLEU and ROUGE are shallow metrics with known limitations. - Create adversarial test sets: typos, abbreviations, code-switching, informal language, domain jargon. - Track inter-annotator agreement (Cohen's kappa) for labeled datasets to quantify annotation quality. ## Before Completing a Task - Run evaluation on the held-out test set and verify metrics meet acceptance thresholds. - Test with adversarial and out-of-distribution inputs to identify failure modes.
Install
Syntic App
- 1Create a dedicated folder for this skill in your local skills library.
- 2Place SKILL.md into that folder.
- 3Restart Syntic and invoke this skill on matching tasks.
Syntic Code (CLI)
- 1Save SKILL.md in your local Syntic Code skills directory.
- 2Keep related files in the same skill folder.
- 3Run in a safe environment and validate outputs.