快捷鍵

CUCTCDecoder

class torchaudio.models.decoder.CUCTCDecoder[原始碼]

CUDA CTC 波束搜尋解碼器。

This feature supports the following devices: CUDA

注意

若要建置解碼器,請使用 factory 函數 cuda_ctc_decoder()

使用 CUCTCDecoder 的教學
ASR Inference with CUDA CTC Decoder

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

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

方法

__call__

CUCTCDecoder.__call__(log_prob: Tensor, encoder_out_lens: Tensor)[原始碼]
參數:
  • log_prob (torch.FloatTensor) – GPU 張量,形狀為 (batch, frame, num_tokens),儲存標籤上的機率分佈序列;log_softmax(聲學模型的輸出)。

  • lengths (dpython:type torch.python:int32) – GPU 張量,形狀為 (batch, ),儲存每個批次中輸出張量在時間軸上的有效長度。

傳回:

批次中每個音訊序列的排序最佳假設清單。

傳回類型:

List[List[CUCTCHypothesis]]

支援結構

CUCTCHypothesis

class torchaudio.models.decoder.CUCTCHypothesis(tokens: List[int], words: List[str], score: float)[原始碼]

表示 CUCTC 波束搜尋解碼器 CUCTCDecoder 產生的假設。

使用 CUCTCHypothesis 的教學
ASR Inference with CUDA CTC Decoder

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

使用 CUDA CTC 解碼器進行 ASR 推論
tokens: List[int]

預測的符記 ID 序列。形狀 (L, ),其中 L 是輸出序列的長度

words: List[str]

預測的符記清單。與建模單元對齊。

score: float

對應於假設的分數

文件

存取 PyTorch 的完整開發者文件

檢視文件

教學

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

檢視教學

資源

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

檢視資源