Reduction of Maximum Entropy Models to Hidden Markov Models