1. A method for computing confidence comprising: with a text recognition system, performing character recognition on an input text image to generate a candidate string of characters; generating a first representation based on the candidate string of characters; generating a second representation based on the input text image; computing a confidence in the candidate string of characters based on a computed similarity between the first and second representations in a common embedding space, at least one of the first and second representations being projected into the common embedding space; and wherein at least one of the performing character recognition, generating the first representation, generating the second representation, and computing the confidence is performed with a computer processor.