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
This commit is contained in:
@@ -26,6 +26,8 @@ class Segment(NamedTuple):
|
|||||||
end: float
|
end: float
|
||||||
text: str
|
text: str
|
||||||
words: Optional[List[Word]]
|
words: Optional[List[Word]]
|
||||||
|
avg_log_prob: float
|
||||||
|
no_speech_prob: float
|
||||||
|
|
||||||
|
|
||||||
class AudioInfo(NamedTuple):
|
class AudioInfo(NamedTuple):
|
||||||
@@ -441,6 +443,8 @@ class WhisperModel:
|
|||||||
if options.word_timestamps
|
if options.word_timestamps
|
||||||
else None
|
else None
|
||||||
),
|
),
|
||||||
|
avg_log_prob=avg_log_prob,
|
||||||
|
no_speech_prob=result.no_speech_prob,
|
||||||
)
|
)
|
||||||
|
|
||||||
def encode(self, features: np.ndarray) -> ctranslate2.StorageView:
|
def encode(self, features: np.ndarray) -> ctranslate2.StorageView:
|
||||||
|
|||||||
Reference in New Issue
Block a user