快捷方式

CUCTCDecoder

class torchaudio.models.decoder.CUCTCDecoder[source]

CUDA CTC 束搜尋解碼器。

This feature supports the following devices: CUDA

注意

要構建解碼器,請使用工廠函式 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)[source]
引數:
  • log_prob (torch.FloatTensor) – 形狀為 (batch, frame, num_tokens) 的 GPU tensor,儲存標籤機率分佈序列;即 log_softmax(聲學模型輸出)。

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

返回:

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

返回型別:

List[List[CUCTCHypothesis]]

支援結構

CUCTCHypothesis

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

表示由 CUCTC 束搜尋解碼器 CUCTCDecoder 生成的假設。

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

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

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

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

words: List[str]

預測 token 列表。與建模單元對齊。

score: float

與假設對應的得分

文件

查閱全面的 PyTorch 開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源