A non-parametric sequence model