Clustering-based construction of Hidden Markov Models for generative kernels