[son of anton]
Deep learning

Text classification

ticket routing, sentiment, content moderation, intent

Assign labels to documents, tickets, or messages.

Probability & Bayes
Information theory
Odds & log-odds
Foundations
Naive Bayes is Bayes' theorem; cross-entropy is the loss for every text classifier since.
Frame the problem
Frame
Multi-class or multi-label. Decide what happens to ambiguous cases.
Labeling & data collection
Data & labels
Annotation guidelines and agreement first. Active learning cuts the labelling bill.
Modalities → vectors
Tokenization
word2vec & GloVebackground
Represent
Bag of words for the baseline; tokens into a pretrained encoder after that.
Split the data
Split
Group by author or source when documents repeat.
Dumb baseline
TF-IDF + linear
Naive Bayes
Attention & transformersbackground
Zero-shot
Prompt an LLM and measure it against the baseline before fine-tuning anything.
The LLM ladder
Fine-tuned encoder
A small encoder, fine-tuned, beats prompting at volume.
Masked & contrastive pretraining
Fine-tuning & LoRA
Model
TF-IDF plus logistic regression, or naive Bayes. Often enough.
Fine-tuning a pretrained model
Handle imbalance
Train
Content moderation is this playbook with extreme imbalance and adversarial drift: retrain often.
Classification metrics
Error analysis & significance
Evaluate offline
Per-class F1. Slice by length, language, and source. For moderation, measure recall on new attack patterns, not last month's.
Evaluate online
Nothing unusual here.
Serving & release
Inference optimisation
Monitor & retrain
Ship & monitor
Cost per call decides encoder versus LLM.
Mini Map