jianfch / stable-ts

Transcription, forced alignment, and audio indexing with OpenAI's Whisper
MIT License
1.59k stars 177 forks source link

split_by_length ignoring locked words #214

Closed jianfch closed 1 year ago

jianfch commented 1 year ago

One more question. In the code below, when I use split_by_length, is it possible to use lock, because it will not lock lowercase words. It would be good if it splits the first word that is not locked after max_words.

result.clamp_max()
result.lock(startswith=lowercase_letters, case_sensitive=True, left=True, right=False)
result.split_by_gap(.1).split_by_length(max_words=30)

Thanks in advance!

Originally posted by @Trsa993 in https://github.com/jianfch/stable-ts/discussions/212#discussioncomment-7151535