class_docstr: Mask-CTC-based non-autoregressive inference
class_docstr_tok: ["Mask-CTC-based","non-autoregressive","inference"]
docstr: Initialize Mask-CTC inference
docstr_tok: ["Initialize","Mask-CTC","inference"]
code: def __init__(
      self,
      asr_model: MaskCTCModel,
      n_iterations: int,
      threshold_probability: float,
  ):
      """Initialize Mask-CTC inference"""
      super().__init__()
      self.ctc = asr_model.ctc
      self.mlm = asr_model.decoder
      self.mask_token = asr_model.mask_token
      self.n_iterations = n_iterations
      self.threshold_probability = threshold_probability
      self.converter = TokenIDConverter(token_list=asr_model.token_list)
  
imports: import logging
  from contextlib import contextmanager
  from itertools import groupby
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from packaging.version import parse
  from typeguard import check_argument_types
  from espnet2.asr.ctc import CTC
  from espnet2.asr.decoder.mlm_decoder import MLMDecoder
  from espnet2.asr.encoder.abs_encoder import AbsEncoder
  from espnet2.asr.espnet_model import ESPnetASRModel
  from espnet2.asr.frontend.abs_frontend import AbsFrontend
  from espnet2.asr.postencoder.abs_postencoder import AbsPostEncoder
  from espnet2.asr.preencoder.abs_preencoder import AbsPreEncoder
  from espnet2.asr.specaug.abs_specaug import AbsSpecAug
  from espnet2.layers.abs_normalize import AbsNormalize
  from espnet2.text.token_id_converter import TokenIDConverter
  from espnet2.torch_utils.device_funcs import force_gatherable
  from espnet.nets.beam_search import Hypothesis
  from espnet.nets.e2e_asr_common import ErrorCalculator
  from espnet.nets.pytorch_backend.maskctc.add_mask_token import mask_uniform
  from espnet.nets.pytorch_backend.nets_utils import th_accuracy
  from espnet.nets.pytorch_backend.transformer.label_smoothing_loss import LabelSmoothingLoss
label_desc: Use image node_id 1 to create a new MaskCTCInference object from inherited base classes: torch.nn with example: obj = MaskCTCInference(asr_model, n_iterations, threshold_probability)