Ising Models with Hidden Markov Structure: Applications to Probabilistic Inference in Machine Learning