50. Tiny Text Classifier with a Transformer Intro in PyTorch
50.1 Tiny Text Classification Goal
Why. Finish Phase 3 with a small text classification loop — embeddings + mean pool + linear head (transformer-style intro without downloading a giant model).
What. Fictional task: label Mauli Dairy WhatsApp-style reviews as positive (1) or negative (0).
How.
Scope the demo
- Fixed tiny vocabulary.
- Pad sequences to equal length.
- Model: Embedding → mean over time → Linear → logit.
- This is an on-ramp; full TransformerEncoder can come later as stretch.
print("Goal: sentiment 0/1 on tiny fictional reviews")