I’d say look around for an HMM package to actually compute a likelihood and run Turing on top of that.