From b4c1c57781607a817b3215a07267f6cef0ba67d1 Mon Sep 17 00:00:00 2001 From: palladium123 <64791747+palladium123@users.noreply.github.com> Date: Mon, 3 Apr 2023 22:56:35 +0800 Subject: [PATCH] Added retrieval mechanism (avg_log_prob/no_speech_prob) (#103) * Added retrieval mechanism Added retrieval mechanism to retrieve avg_log_prob and no_speech_prob from the Transcribe method. * Update transcribe.py * Update transcribe.py * Initial commit --- faster_whisper/transcribe.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/faster_whisper/transcribe.py b/faster_whisper/transcribe.py index 813b4b8..21622db 100644 --- a/faster_whisper/transcribe.py +++ b/faster_whisper/transcribe.py @@ -26,6 +26,8 @@ class Segment(NamedTuple): end: float text: str words: Optional[List[Word]] + avg_log_prob: float + no_speech_prob: float class AudioInfo(NamedTuple): @@ -441,6 +443,8 @@ class WhisperModel: if options.word_timestamps else None ), + avg_log_prob=avg_log_prob, + no_speech_prob=result.no_speech_prob, ) def encode(self, features: np.ndarray) -> ctranslate2.StorageView: