First assignment
  1. install python if you don't already have it (instructions)
  2. play with it
  3. exercise in trigram probabilities (details below)
  4. think about online data that might be fun to harvest and analyze
  5. find an interesting python script on-line to discuss in class

Trigram probabilities (a.k.a. Mark V Shaney)

As explained in class, p(w3 | w1 w2) is the conditional probablity that w3 occurs following the two words "w1 w2". It can be estimated from some training corpus by counting the number of times that the three word sequence "w1 w2 w3" occurs, and dividing by the number of times that "w1 w2" occurs, giving the fraction of times that "w1 w2" is followed by w3 in the training corpus.

The object of this exercise is to gain some experience in identifying a training corpus, learning how to read in text to a program, and using random numbers to generate text from a language model. (Some of these you can base on the reading spell-correct for next weeks's class. It is also fine to discuss methodologies on Piazza. If you really don't know where to start, there are many hints given in a similar assignment here.) Once you've chosen text to train the trigram probabilities, you can generate random text by starting from a random bigram (or from one known to start a sentence in the training set).

Here are samples generated using a perl version, the first trained on computer science abstracts, the second on high energy physics abstracts. Note that you'll have various design choices re handling punctuation, etc.