Python 101, Hard
The fundamentals: variables, types, control flow, functions, then a tiny language model.
📖 10 ⏱ ~4h 📦 5 ⚡ +1500 XP
📚
Module 1
→ Loading a Text Corpus
Load, inspect, and understand the structure of a text corpus stored in CSV, the raw material for our tiny language model.
🔤
Module 2
→ Tokenization & Word Frequency
Split raw text into tokens, count word frequencies, and build the vocabulary for our language model.
🔗
Module 3
→ Bigram Probability Tables
Build and normalize bigram count tables that map each word to the words that follow it.
🎲
Module 4
→ The generate_text() Function
Use random.choices to sample the next word from a bigram table and generate coherent text sequences.
🖥️
Module 5
→ CLI Text Generator & Temperature
Assemble all pieces into a command-line text generator and add a temperature parameter to control creativity.