Learning to Label Sequences