Text this: Dynamic graph cuts for efficient inference in Markov random fields