class_docstr: Implementation of the confidence ensemble model.
  
  See https://arxiv.org/abs/2306.15824 for details.
  
  .. note::
      Currently this class only support `transcribe` method as it requires
      full-utterance confidence scores to operate.
class_docstr_tok: ["Implementation","of","the","confidence","ensemble","model",".","See","https",":","\/\/arxiv.org\/abs\/2306.15824","for","details",".","..","note",":",":","Currently","this","class","only","support","`","transcribe","`","method","as","it","requires","full-utterance","confidence","scores","to","operate","."]
docstr: Confidence-ensemble transcribe method.
  
  Consists of the following steps:
  
      1. Run all models (TODO: in parallel)
      2. Compute confidence for each model
      3. Use logistic regression to pick the "most confident" model
      4. Return the output of that model
docstr_tok: ["Confidence-ensemble","transcribe","method",".","Consists","of","the","following","steps",":","1",".","Run","all","models","(","TODO",":","in","parallel",")","2",".","Compute","confidence","for","each","model","3",".","Use","logistic","regression","to","pick","the","``","most","confident","''","model","4",".","Return","the","output","of","that","model"]
code: def transcribe(
      self,
      paths2audio_files: List[str],
      batch_size: int = 4,
      return_hypotheses: bool = False,
      num_workers: int = 0,
      channel_selector: Optional[ChannelSelectorType] = None,
      augmentor: DictConfig = None,
      verbose: bool = True,
      **kwargs,  # any other model specific parameters are passed directly
  ) -> List[str]:
      """Confidence-ensemble transcribe method.
  
      Consists of the following steps:
  
          1. Run all models (TODO: in parallel)
          2. Compute confidence for each model
          3. Use logistic regression to pick the "most confident" model
          4. Return the output of that model
      """
      confidences = []
      all_transcriptions = []
      # always requiring to return hypothesis
      # TODO: make sure to return text only if was False originally
      return_hypotheses = True
      for model_idx in range(self.num_models):
          model = getattr(self, f"model{model_idx}")
          transcriptions = model.transcribe(
              paths2audio_files=paths2audio_files,
              batch_size=batch_size,
              return_hypotheses=return_hypotheses,
              num_workers=num_workers,
              channel_selector=channel_selector,
              augmentor=augmentor,
              verbose=verbose,
              **kwargs,
          )
          if isinstance(
              transcriptions, tuple
          ):  # transducers return a tuple
              transcriptions = transcriptions[0]
  
          model_confidences = []
          for transcription in transcriptions:
              model_confidences.append(
                  compute_confidence(transcription, self.confidence_cfg)
              )
          confidences.append(model_confidences)
          all_transcriptions.append(transcriptions)
  
      # transposing with zip(*list)
      features = np.array(list(zip(*confidences)))
      model_indices = self.model_selection_block.predict(features)
      final_transcriptions = []
      for transcrption_idx in range(len(all_transcriptions[0])):
          final_transcriptions.append(
              all_transcriptions[model_indices[transcrption_idx]][
                  transcrption_idx
              ]
          )
  
      return final_transcriptions
  
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 7 for calling the ConfidenceEnsembleModel obj's underlying member method code with example usage: obj.transcribe(paths2audio_files, batch_size, return_hypotheses, num_workers, channel_selector, augmentor, verbose) and returns: final_transcriptions