Text this: Loglinear models with latent variables