class_docstr: A class designed for extracting word timestamps while the ASR decoding process.
  This class contains a few setups for a slew of NeMo ASR models such as QuartzNet, CitriNet and ConformerCTC models.
class_docstr_tok: ["A","class","designed","for","extracting","word","timestamps","while","the","ASR","decoding","process",".","This","class","contains","a","few","setups","for","a","slew","of","NeMo","ASR","models","such","as","QuartzNet",",","CitriNet","and","ConformerCTC","models","."]
docstr: Load a language model for CTC decoder (pyctcdecode).
  Note that only EncDecCTCModel and EncDecCTCModelBPE models can use pyctcdecode.
docstr_tok: ["Load","a","language","model","for","CTC","decoder","(","pyctcdecode",")",".","Note","that","only","EncDecCTCModel","and","EncDecCTCModelBPE","models","can","use","pyctcdecode","."]
code: def load_LM_for_CTC_decoder(
      self, asr_model: Type[Union[EncDecCTCModel, EncDecCTCModelBPE]]
  ):
      """
      Load a language model for CTC decoder (pyctcdecode).
      Note that only EncDecCTCModel and EncDecCTCModelBPE models can use pyctcdecode.
      """
      kenlm_model = self.ctc_decoder_params["pretrained_language_model"]
      logging.info(
          f"Loading language model : {self.ctc_decoder_params['pretrained_language_model']}"
      )
  
      if "EncDecCTCModelBPE" in str(type(asr_model)):
          vocab = asr_model.tokenizer.tokenizer.get_vocab()
          labels = list(vocab.keys())
          labels[0] = "<unk>"
      elif "EncDecCTCModel" in str(type(asr_model)):
          labels = asr_model.decoder.vocabulary
      else:
          raise ValueError(
              f"Cannot find a vocabulary or tokenizer for: {self.params['self.ASR_model_name']}"
          )
  
      decoder = build_ctcdecoder(
          labels,
          kenlm_model,
          alpha=self.ctc_decoder_params["alpha"],
          beta=self.ctc_decoder_params["beta"],
      )
      return decoder
  
imports: import copy
  import math
  from typing import Dict, List, Tuple, Type, Union
  import numpy
  import torch
  from omegaconf import OmegaConf
  import nemo.collections.asr
  from nemo.collections.asr.metrics.wer import WER
  from nemo.collections.asr.models import EncDecCTCModel, EncDecCTCModelBPE
  from nemo.collections.asr.parts.submodules.ctc_decoding import CTCBPEDecoding, CTCBPEDecodingConfig, CTCDecoding, CTCDecodingConfig
  from nemo.collections.asr.parts.utils.audio_utils import get_samples
  from nemo.collections.asr.parts.utils.speaker_utils import audio_rttm_map, get_uniqname_from_filepath
  from nemo.collections.asr.parts.utils.streaming_utils import AudioFeatureIterator, FrameBatchASR
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling the ASRDecoderTimeStamps obj's underlying member method code with example usage: obj.load_LM_for_CTC_decoder(asr_model) and returns: decoder