Comparing CRF and HMM
A complete comparison of CRF and HMM models is beyond the scope of this book. However, there are some obvious differences due to the simple fact that HMM is a generative model and CRF is a discriminative model.
Contrary to the hidden Markov model, the conditional random field does not require the observations to be independent beside the time and order dependency. The conditional random field can be regarded as a generalization of the HMM: It extends the transition probabilities to arbitrary feature functions that can depend on the input sequence. You need to remember that HMM assumes the transition probabilities matrix to be constant.
HMM learns the transition probabilities, aij, on its own by training on an increasing amount of input data. The HMM is a special case of CRF where the probabilities used in the state transition are constant.