You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
993 B
Markdown
13 lines
993 B
Markdown
---
|
|
# edu-4gok
|
|
title: 'Markov exercise: N-gram Generalization (Rust)'
|
|
status: completed
|
|
type: task
|
|
priority: high
|
|
created_at: 2026-03-10T23:30:00Z
|
|
updated_at: 2026-03-13T22:37:26Z
|
|
parent: edu-svom
|
|
---
|
|
|
|
Write Section 8 of edu/markov.md: Exercise 4 — N-gram Generalization\n\nLearning objectives:\n- Generalize from bigrams to arbitrary-order n-gram chains\n- Use Vec<String> as a HashMap key (or a joined string)\n- Empirically compare output quality for n = 1, 2, 3, 4\n\nContent to produce:\n- Setup instructions (extend Exercise 3 project)\n- Step-by-step hints:\n 1. Modify train to use a sliding window of n words as the key\n 2. Modify generate to maintain a deque/window of the last n words\n 3. Run on the same corpus with n = 1, 2, 3, 4 and print 50 words each\n 4. Discuss observations: when does it start memorising the corpus?\n- Full reference solution\n- Stretch goal: implement character-level n-grams instead of word-level\n\nTarget: replace the stub in edu/markov.md §8
|