02 / Programme
Applied NLP with Python
Turn unstructured text into systems you can evaluate — from preprocessing and classification to embeddings, NER and transformers.
2 days · Up to 12 participants · On-site or remote · From £7,000
Who it is for
Engineers and analysts who need to build text pipelines in Python: search, classification, extraction, or a path into modern models.
Who it is not
It is not a linguistics seminar, and it is not a one-hour tour of a hosted API. Delegates implement, measure and compare.
What they will be able to do
- 01
Build a preprocessing pipeline you can defend: tokenisation, Unicode normalisation, stemming, lemmatisation.
- 02
Vectorise a corpus with bag-of-words, n-grams and TF-IDF, and retrieve with cosine similarity.
- 03
Train and compare Naive Bayes, logistic regression and SVM with precision, recall, F1 and cross-validation.
- 04
Fit LDA and NMF, and interpret topics against a corpus that has known labels.
- 05
Train Word2Vec, use GloVe, and see where static embeddings beat TF-IDF — and where they do not.
- 06
Extract structure with spaCy (POS, dependencies, NER, EntityRuler), run transformer pipelines, and deploy a FastAPI service.
Outline
Day 01
Classical NLP foundations
- 00
Python for text
The analyst’s toolkit: strings and f-strings, regular expressions, pathlib and encoding, Counter and defaultdict, type hints, argparse. Load a corpus, extract structure, compute frequencies.
- 01
Text preprocessing
Tokenisation (NLTK Punkt and spaCy), case folding, regex cleaning, Unicode normalisation, stopwords, Porter stemming, WordNet lemmatisation. A pipeline you can run over a batch and audit.
- 02
Feature extraction
The vector space model. Bag-of-words, n-grams, TF-IDF (weighting, variants, smoothing), cosine similarity, sparsity. scikit-learn vectorisers. Fingerprint documents and rank nearest neighbours.
- 03
Text classification
Train/test splits and sklearn pipelines. Naive Bayes, logistic regression, SVM. Precision, recall, F1, confusion matrices, cross-validation. A classifier shootout on the same split — including a real public corpus, not only course data.
- 04
Topic modelling
Day 1 closer. Unsupervised discovery: LDA (the generative story, Dirichlet priors), NMF, perplexity and coherence, labelling topics. Compare models and topic counts against a corpus with known categories, so the topics cannot hide.
Day 02
Meaning, structure, and models
- 05
Word embeddings
Distributional semantics. Word2Vec (CBOW, skip-gram, negative sampling), GloVe, document vectors. Similarity, analogies, odd-one-out. Static versus contextual embeddings. Optional API embeddings for the pairs TF-IDF misses.
- 06
Linguistic structure
The spaCy pipeline. UPOS tagging, dependency parsing and SVO extraction, NER (BIO scheme, span-level precision and recall), EntityRuler for domain IDs and other custom entities.
- 07
Transformers
Self-attention (Q/K/V), multi-head attention, positional encodings. BERT (MLM, NSP), DistilBERT, BPE and WordPiece. Hugging Face pipelines: sentiment, NER, zero-shot, summarisation. Generation temperature. Optional DistilBERT fine-tuning.
- 08
Capstone pipeline
End to end on a real public corpus: choose data, train a baseline, compare a transformer, persist with joblib, error analysis, deploy as a FastAPI service.
How it is taught
Labs with pytest, live coding, and comparison against real public corpora as well as course data. Slides support the room; they are not the course.
Delivery and price
From £7,000 for up to 12 participants, on-site or remote. Talk to us to confirm dates, location, and any tailoring.
Instructor
Nicholas Johnson, AI architect and software engineer. Degree in Artificial Intelligence; around twenty years of professional technology training. About.