Latent Variable Models of Sequence Data for Classification and Discovery