Latent Variable Model for Learning in Pairwise Markov Networks