

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


The goal of this assignment is to implement a Hidden Markov Model (HMM) to label words with their part-of-speech. Here, the observation sequence is a sentence, and the hidden states represent the part-of-speech for each word. A description of HMMs can be found in the lecture slides as well as in the Manning and Schutze text. For the main assignment, you can assume that you have completely labeled training data, which means you do not have to use Baum-Welch to estimate the parameters of the model.
The data was collected from http://cnts.uia.ac.be/conll2000/chunking/. For this assignment, use the slightly modified version found at http://canberra.cs.umass.edu/~culotta/cs585/ass3-data.tgz (280K). The data has already been split into train.txt (˜4K sentences) and test.txt (˜1K sentences). Each sentence in the file is separated by a blank line, and each word is placed on a separate line with its true part-of-speech.
To deal with out-of-vocabulary words (words in the test set but not in the training set), you should first read in all sentences (testing and training) to create a dictionary of all words V. If S is the set of states, then you must estimate and store the |S|x|S| transition probability matrix A and the |S| x |V | emission probability matrix B. Remember to include initial and final “dummy” states. Also, use Laplacian smoothing (a.k.a. +1 smoothing) as you did for previous assignments. When implementing the Viterbi algorithm, use assertions liberally to avoid any “off-by-one” errors.
Train your HMM using the sentences in train.txt, and then test the HMM on the sentences in test.txt. Report the precision and recall for each of the
8 parts of speech, as well as the overall precision.
Additional Experiments
Perform 1 of the following 3 experiments:
Code: Print out all source code written for the project. Report: Write a 2 page report that includes the following: