Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 2.23 KB

File metadata and controls

35 lines (29 loc) · 2.23 KB

Class 6: Generating Sentences

Activities

  • Compare histogram functions to Dictogram and Listogram class instance methods
  • Quick lecture and discussion on how OOP actually works under the hood
  • Lecture and discussion on building Markov chains and performing random walks

Objectives

After completing this class session and the associated tutorial challenges, students will be able to ...

  • Build Markov chains based on observed frequency of adjacent words in text
  • Generate sentences by sampling words by performing random walks on Markov chain

Challenges

These challenges are the baseline required to complete the project and course. Be sure to complete these before next class session and before starting on the stretch challenges below.

  • Page 7: Generating Sentences
    • Build a Markov chain by analyzing frequency of adjacent words in text
    • Sample a random word from a state histogram in a Markov chain
    • Generate a sentence by performing a random walk on Markov chain

Stretch Challenges

These challenges are more difficult and help you push your skills and understanding to the next level.

  • Page 7: Generating Sentences
    • Implement MarkovChain class to store states of word frequency histograms
      • Add methods for constructing state histograms and sampling words
    • Handle beginning and end of sentences with special start and stop tokens

Resources