Loopy Belief Propagation for Approximate Inference: An Empirical Study