RealtimeSTT icon indicating copy to clipboard operation
RealtimeSTT copied to clipboard

feat: add new option "return_segments" to allow accessing word probabilities and other meta information

Open oddlama opened this issue 1 year ago • 1 comments

Currently RealtimeSTT doesn't expose the meta information about segments and their words, which are otherwise available when passing word_timestamps=True to the faster-whisper model. This information is very nice to have when building an application on top of RealtimeSTT, since it allow displaying word detection certainties, or to align words temporally.

This introduces a new option return_segments that enables word_timestamps=True on both the realtime and main model, and causes the related functions to take a tuple (text, segments) instead of just text. This change is opt-in and fully backward compatible.

oddlama avatar Jun 20 '24 15:06 oddlama

I will address the conflicts as soon as #71 is addressed, otherwise I can't test my changes.

oddlama avatar Jun 20 '24 15:06 oddlama