Text this: Approximate Counting, the Lovász Local Lemma, and Inference in Graphical Models