快捷鍵

cuda_ctc_decoder

torchaudio.models.decoder.cuda_ctc_decoder(tokens: Union[str, List[str]], nbest: int = 1, beam_size: int = 10, blank_skip_threshold: float = 0.95) CUCTCDecoder[原始碼]

建構 CUCTCDecoder 的實例。

參數:
  • tokens (strList[str]) – 包含有效 tokens 的檔案或列表。如果使用檔案,預期格式是將映射到相同索引的 tokens 放在同一行

  • beam_size (int, optional) – 每次解碼步驟後要保留的最大假設數量 (預設值:10)

  • nbest (int) – 要傳回的最佳解碼數量

  • blank_id (int) – 對應於空白符號的 token ID。

  • blank_skip_threshold (float) – 如果 log_prob(blank) > log(blank_skip_threshold),則跳過影格,以加速解碼 (預設值:0.95)。

返回:

解碼器

返回類型:

CUCTCDecoder

範例
>>> decoder = cuda_ctc_decoder(
>>>     vocab_file="tokens.txt",
>>>     blank_skip_threshold=0.95,
>>> )
>>> results = decoder(log_probs, encoder_out_lens) # List of shape (B, nbest) of Hypotheses
使用 cuda_ctc_decoder 的教學
ASR Inference with CUDA CTC Decoder

使用 CUDA CTC 解碼器進行 ASR 推論

使用 CUDA CTC 解碼器進行 ASR 推論

文件

存取 PyTorch 的完整開發者文件

查看文件

教學

取得初學者和進階開發者的深入教學

查看教學

資源

尋找開發資源並獲得問題解答

查看資源