Markov logic networks for optical chemical structure recognition