Learning Hidden Markov Models from Pairwise Co-occurrences with Applications to Topic Modeling