docstr: Converts confidence spec to the confidence config.
  
  Internally, the tuning procedure uses this "spec" objects as they
  are more aligned with how things are implemented. But when it's time
  to save the models or call transcribe, we need to use the proper
  object of type ``ConfidenceConfig``.
docstr_tok: ["Converts","confidence","spec","to","the","confidence","config",".","Internally",",","the","tuning","procedure","uses","this","``","spec","''","objects","as","they","are","more","aligned","with","how","things","are","implemented",".","But","when","it","'s","time","to","save","the","models","or","call","transcribe",",","we","need","to","use","the","proper","object","of","type","``","ConfidenceConfig","``","."]
code: def to_confidence_config(self) -> ConfidenceConfig:
      """Converts confidence spec to the confidence config.
  
      Internally, the tuning procedure uses this "spec" objects as they
      are more aligned with how things are implemented. But when it's time
      to save the models or call transcribe, we need to use the proper
      object of type ``ConfidenceConfig``.
      """
      if self.confidence_type == "max_prob":
          name = "max_prob"
          entropy_type = "tsallis"  # can be any
          entropy_norm = "lin"  # can be any
      else:
          name, entropy_type, entropy_norm = self.confidence_type.split(
              "_"
          )
      return ConfidenceConfig(
          exclude_blank=self.exclude_blank,
          aggregation=self.aggregation,
          method_cfg=ConfidenceMethodConfig(
              name=name,
              entropy_type=entropy_type,
              alpha=self.alpha,
              entropy_norm=entropy_norm,
          ),
      )
  
imports: from dataclasses import dataclass
  from typing import Dict, List, Optional, Union
  import joblib
  import numpy
  import torch
  from omegaconf import DictConfig, open_dict
  from pytorch_lightning import Trainer
  from nemo.collections.asr.models.asr_model import ASRModel
  from nemo.collections.asr.models.hybrid_rnnt_ctc_models import EncDecHybridRNNTCTCModel
  from nemo.collections.asr.parts.utils.asr_confidence_utils import ConfidenceConfig, ConfidenceMethodConfig, get_confidence_aggregation_bank, get_confidence_measure_bank
  from nemo.collections.asr.parts.utils.audio_utils import ChannelSelectorType
  from nemo.collections.asr.parts.utils.rnnt_utils import Hypothesis
  from nemo.core.classes import ModelPT
  from nemo.utils import model_utils
label_desc: Use image node_id 1 for calling the ConfidenceSpec obj's underlying member method code with example usage: obj.to_confidence_config() and returns: ConfidenceConfig