Lab: The first trained intent classifier, versioned
Module 4 · Lab · About 60 minutes · Needs: lessons 1 to 4 of this module, and the Module 3 lab (or its cells, pasted here)
What you are building
It is project week 4, and Rosa wants a trained router that beats the keyword rules from Module 1. The four lessons each appended parts to two files: word counts, n-grams and TF-IDF to inbox/features.py, naive Bayes and logistic regression to inbox/classify.py. This lab settles each file into one version with one test file, picks the regularisation strength on the dev split, and scores the rules, naive Bayes and logistic regression side by side on the template test split and on Ines's 80 hand-written messages, language by language. Last, it saves the logistic regression as version 1 of a pipeline, with a JSON card, and serves it through the course's predict(texts).
Open a new Colab notebook, call it module-04-lab.ipynb, and run each cell in order.