Variational bayes inference of Ising models and their applications