Remix.run Logo
justinhunt 17 hours ago

This is very interesting. I do something related: matching student oral reading transcripts back against the text they were assigned to read.Students will misread then re-read a sentence, skip sentences, skip paragraphs etc.

I think its similar because we both seek to assign audio time stamps to sentences and words.

But I wonder why your forced alignment algorithm is so heavy duty. (My head started to spin at CTC emissions. ) Probably yours is just way more thorough than mine,

My simplistic approach would have been to transcribe the audio. And then run a differencing script chapter by chapter matching the book text with the audio transcript. And then do something similar intra chapter to get sentence and word level time stamps.

smoores 17 hours ago | parent [-]

Oh, cool! Yeah that seems like a good application.

The current Storyteller alignment algorithm actually does do just that! We use Whisper to transcribe the audio to text, and then use error-align[1] to align on the text.

There are a few disadvantages to this approach:

1. Whisper only supports ~25 languages, and only about 10 of those very well. We want to support more languages, and Massively Multilingual Speech supports "1000+" 2. Whisper's timing outputs are not very good. We want to do word-level highlighting, like in the demo at the top of the post, but in order for that to be a good user experience, those timings need to be very precise. Much easier to do that with CTC!

CTC Viterbi is the tried and true forced alignment algorithm for good reason. It's not really that it's heavier duty than running Whisper and aligning on the output. Rather, it's like you stop Whisper early, before it does the final step of actually producing text, and step in and say: take the data you just calculated and use it to produce _this_ text, specifically. And then, since it produced _your_ text, you don't have to do anything else, you just use the timestamps directly.

The only reason Storyteller never used it in the past is because I couldn't come up with a good way to do the boundary search I describe in this post! This is super important for books in a way that it may not be for your oral reading transcript use case, because chapters can be (and often are) out of order between the ebook and audiobook. But once I worked out the n-gram RANSAC approach, it became much more tenable.

[1]: https://github.com/corticph/error-align

justinhunt 16 hours ago | parent | next [-]

Thanks for the reply and explanation. It is very helpful. Our app is old, started well prior to whisper. But we have updated it regularly as useful tech came along. I will check out CTC Viterbi and error-align !

jimmySixDOF 8 hours ago | parent [-]

slightly tangential but the podcast app Snipd has a lot of text to speach re-sync alignment to recover from inserted advertisements so it might be worth exploring if they have published any details

fwip 16 hours ago | parent | prev [-]

Have you looked at existing genomic alignment algorithms? I'd be surprised if Needleman-Wunsch didn't fit your needs.

smoores 16 hours ago | parent [-]

Viterbi and Needleman-Wunsch are essentially the same algorithm, developed in parallel for two different domains! The Viterbi formulation of the algorithm is the one usually applied to signal decoding, since that's what it was originally designed for.

fwip 15 hours ago | parent [-]

Oh cool, thanks for explaining to me!