Live data from Hacker News

Automating Immersive Reading

smoores.dev

41–50 of 53 posts

Re: Automating Immersive Reading

#41

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 emi…

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

Re: Automating Immersive Reading

#42
post #41

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 emi…

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 supp…

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

Re: Automating Immersive Reading

#43
post #2

I took a week of from work recently to reimplement Storyteller's forced alignment algorithm. Storyteller[1] is an open source, self hosted platform for creating, managing, and reading/listening to "readaloud" books — books that have audiobook narration built in and can highlight each sentence (and/or word, with this new algorithm!) as it's read aloud. Forced alignment is the process of determining where each piece of…

Cool! S an avid reader, Whispersync is one of the things that keeps me paying Amazon/Audible. Competition and viable OSS alternatives would be great!

I'll post again when we release the v3 apps — even in alpha, they're really awesome, I think they blow the Kindle app out of the water!

Re: Automating Immersive Reading

#44
post #41

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 emi…

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 supp…

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 !

Re: Automating Immersive Reading

#45
post #42
post #41

Earlier quoted context omitted.

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 supp…

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

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.

Re: Automating Immersive Reading

#46
post #45
post #42

Earlier quoted context omitted.

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

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.

Oh cool, thanks for explaining to me!

Re: Automating Immersive Reading

#48
post #25
post #16

Earlier quoted context omitted.

Wow I didn't even think about just using on device AI. I'm going to set this one up and try it with kokoro which has the most natural for small size that I've seen. Wonder if the paperwhite 12th Gen can handle it. And also setup the main repo for when I have the real audio book. Thanks!

I tried running Kokoro on my iPhone XS (several years old), and it was slower than real-time. So, i wouldn’t expect it to be usable on a Kindle. But if you find a solution, please let me know.

Kokoro can be hacked a bit (see script https://github.com/DavidVentura/translator-rs/blob/master/sc... ) which makes it about 3x faster.

My phone went from slightly slower than realtime to very comfortable (also lower latency on first utterance!)

Re: Automating Immersive Reading

#49
post #41

Earlier quoted context omitted.

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 supp…

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 !

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

Re: Automating Immersive Reading

#50
post #26
post #24

I thought reading becomes immersive if you like the book...

Sure! Some people have print disabilities like dyslexia and neurodivergence that makes reading text for an entire novel-length book challenging. Other people are perfectly competent print readers, but find that they enjoy having their book read to them. Audiobooks are their own art form, and it's nice to be able to enjoy them alongside text. "Immersive reading" seems to be the industry term for this feature — I used…

Well I'm afraid it reminds me of newspeak.
Post reply on HN