class_docstr: Joint denoising training task for speech and text.
class_docstr_tok: ["Joint","denoising","training","task","for","speech","and","text","."]
code: def load_dataset(self, split, epoch=1, combine=False, **kwargs):
      def _get_sup_src_tgt_dict(
          src_dict, tgt_dict, use_s2s_sup_decoder
      ):
          if use_s2s_sup_decoder:
              return None, tgt_dict
          # use src_dict as tgt_dict here, since we use source dictionary as target for forcealignment
          return None, src_dict
  
      is_train, dtype = self.resolve_data_type(
          split, self.args.use_sup_speech_ctc
      )
  
      # Note we use --add-tgt-lang-token instead of data_cfg.prepend_tgt_lang_tag_no_change to set target language tag in the text dataset
      # Verify add_tgt_lang_token and prepend_tgt_lang_tag_no_change are same
  
      # Note we use --multilang-sampling-alpha instead of data_cfg.sampling_text_alpha to set text data sampling
      if is_train:
          msets = []
          # train split, load everything into one
          if self.lang_pairs != "":
              text_dataset = self.load_dataset_only(
                  "train", self.lang_pairs, epoch=epoch, combine=combine
              )
              dsitem = self.create_modalitydatasetitem(
                  "text", text_dataset
              )
              msets.append(dsitem)
          if self.lang_pairs_bitext != "":  # load bitext
              bitext_dataset = self.load_dataset_only(
                  "train_bitext",
                  self.lang_pairs_bitext,
                  do_mask=False,
                  epoch=epoch,
                  combine=combine,
              )
              dsitem = self.create_modalitydatasetitem(
                  "bitext", bitext_dataset
              )
              msets.append(dsitem)
          if self.args.sup_speech_train_subset != "":
              pre_tokenizer = self.build_tokenizer(self.data_cfg)
              bpe_tokenizer = self.build_bpe(self.data_cfg)
  
              append_eos = True
              sup_speech_type = "sup_speech_ali"
              if self.args.use_sup_speech_ctc:
                  # CTC mode
                  sup_speech_type = "sup_speech_ctc"
                  append_eos = (
                      False  # CTC doesn't need eos in the target
                  )
  
              src_dict, tgt_dict = _get_sup_src_tgt_dict(
                  self.src_dict, self.tgt_dict, False
              )
              sup_speech_dataset = (
                  SpeechToTextJointDatasetCreator.from_tsv(
                      self.args.sup_speech_data,
                      self.data_cfg,
                      self.args.sup_speech_train_subset,
                      tgt_dict=tgt_dict,
                      src_dict=src_dict,
                      pre_tokenizer=pre_tokenizer,
                      bpe_tokenizer=bpe_tokenizer,
                      src_pre_tokenizer=None,
                      src_bpe_tokenizer=None,
                      is_train_split=is_train,
                      epoch=epoch,
                      seed=self.args.seed,
                      append_eos=append_eos,
                  )
              )
              dsitem = self.create_modalitydatasetitem(
                  sup_speech_type, sup_speech_dataset
              )
              msets.append(dsitem)
  
          if self.args.sup_speech_s2s_train_subset != "":
              pre_tokenizer = self.build_tokenizer(
                  self.data_s2s_cfg, msg="(s2s)"
              )
              bpe_tokenizer = self.build_bpe(
                  self.data_s2s_cfg, msg="(s2s)"
              )
  
              # make sure self.data_cfg.prepend_tgt_lang_tag_no_change == self.args.add_tgt_lang_token
              src_dict, tgt_dict = _get_sup_src_tgt_dict(
                  self.src_dict, self.tgt_dict, True
              )
              sup_speech_s2s_dataset = (
                  SpeechToTextJointDatasetCreator.from_tsv(
                      self.args.sup_speech_s2s_data,
                      self.data_s2s_cfg,
                      self.args.sup_speech_s2s_train_subset,
                      tgt_dict=tgt_dict,
                      src_dict=src_dict,
                      pre_tokenizer=pre_tokenizer,
                      bpe_tokenizer=bpe_tokenizer,
                      src_pre_tokenizer=None,
                      src_bpe_tokenizer=None,
                      is_train_split=is_train,
                      epoch=epoch,
                      seed=self.args.seed,
                  )
              )
              dsitem = self.create_modalitydatasetitem(
                  "sup_speech_s2s", sup_speech_s2s_dataset
              )
              msets.append(dsitem)
          if self.args.unsup_speech_train_data != "":
              unsup_speech_dataset = FileAudioDatasetWrapper(
                  self.args.unsup_speech_train_data,
                  self.args.sample_rate,
                  max_sample_size=self.args.max_sample_size,
                  min_sample_size=self.args.min_sample_size,
                  normalize=False,
              )
              dsitem = self.create_modalitydatasetitem(
                  "unsup_speech", unsup_speech_dataset
              )
              msets.append(dsitem)
  
          pre_train_dataset = MultiModalityDataset(msets)
          self.datasets[split] = pre_train_dataset
      else:  # validation split, load them for each type of data
          if dtype == "text":
              text_dataset = self.load_dataset_only(
                  split, self.lang_pairs, epoch=epoch, combine=combine
              )
              dsitem = self.create_modalitydatasetitem(
                  "text", text_dataset
              )
              self.datasets[split] = MultiModalityDataset([dsitem])
          elif dtype == "bitext":
              bitext_dataset = self.load_dataset_only(
                  split,
                  self.lang_pairs_bitext,
                  do_mask=False,
                  epoch=epoch,
                  combine=combine,
              )
              dsitem = self.create_modalitydatasetitem(
                  "bitext", bitext_dataset
              )
              self.datasets[split] = MultiModalityDataset([dsitem])
  
          elif dtype in ("sup_speech_ctc", "sup_speech_ali"):
              assert self.args.sup_speech_valid_subset != ""
              pre_tokenizer = self.build_tokenizer(self.data_cfg)
              bpe_tokenizer = self.build_bpe(self.data_cfg)
              append_eos = True
              if dtype == "sup_speech_ctc":
                  # CTC mode
                  append_eos = False  # CTC doesn't need eos
                  assert self.args.use_sup_speech_ctc
  
              datasets = []
              for split_name in self.args.sup_speech_valid_subset.split(
                  ","
              ):
                  src_dict, tgt_dict = _get_sup_src_tgt_dict(
                      self.src_dict, self.tgt_dict, False
                  )
                  datasets.append(
                      SpeechToTextJointDatasetCreator.from_tsv(
                          self.args.sup_speech_data,
                          self.data_cfg,
                          split_name,
                          tgt_dict=tgt_dict,
                          src_dict=src_dict,
                          pre_tokenizer=pre_tokenizer,
                          bpe_tokenizer=bpe_tokenizer,
                          src_pre_tokenizer=None,
                          src_bpe_tokenizer=None,
                          is_train_split=is_train,
                          epoch=epoch,
                          seed=self.args.seed,
                          append_eos=append_eos,
                      )
                  )
  
              dset = (
                  datasets[0]
                  if len(datasets) == 1
                  else ConcatDataset(datasets)
              )
              dsitem = self.create_modalitydatasetitem(dtype, dset)
              self.datasets[split] = MultiModalityDataset([dsitem])
  
          elif dtype == "sup_speech_s2s":
              assert self.args.sup_speech_s2s_valid_subset != ""
              pre_tokenizer = self.build_tokenizer(self.data_s2s_cfg)
              bpe_tokenizer = self.build_bpe(self.data_s2s_cfg)
              datasets = []
              for (
                  split_name
              ) in self.args.sup_speech_s2s_valid_subset.split(","):
                  src_dict, tgt_dict = _get_sup_src_tgt_dict(
                      self.src_dict, self.tgt_dict, True
                  )
                  datasets.append(
                      SpeechToTextJointDatasetCreator.from_tsv(
                          self.args.sup_speech_s2s_data,
                          self.data_s2s_cfg,
                          split_name,
                          tgt_dict=tgt_dict,
                          src_dict=src_dict,
                          pre_tokenizer=pre_tokenizer,
                          bpe_tokenizer=bpe_tokenizer,
                          src_pre_tokenizer=None,
                          src_bpe_tokenizer=None,
                          is_train_split=is_train,
                          epoch=epoch,
                          seed=self.args.seed,
                      )
                  )
  
              dset = (
                  datasets[0]
                  if len(datasets) == 1
                  else ConcatDataset(datasets)
              )
              dsitem = self.create_modalitydatasetitem(
                  "sup_speech_s2s", dset
              )
              self.datasets[split] = MultiModalityDataset([dsitem])
          elif dtype == "unsup_speech":
              assert self.args.unsup_speech_valid_data != ""
              unsup_speech_dataset = FileAudioDatasetWrapper(
                  self.args.unsup_speech_valid_data,
                  self.args.sample_rate,
                  max_sample_size=self.args.max_sample_size,
                  min_sample_size=self.args.min_sample_size,
                  normalize=False,
              )
              dsitem = self.create_modalitydatasetitem(
                  "unsup_speech", unsup_speech_dataset
              )
              self.datasets[split] = MultiModalityDataset([dsitem])
          else:
              raise ValueError(f"Unsupported type {dtype}")
  
imports: import logging
  import os
  import re
  from argparse import Namespace
  from pathlib import Path
  from fairseq.data import ConcatDataset, Dictionary, encoders
  from fairseq.data.audio.multi_modality_dataset import FileAudioDatasetWrapper, ModalityDatasetItem, MultiModalityDataset
  from fairseq.data.audio.speech_to_text_joint_dataset import S2TJointDataConfig, SpeechToTextJointDatasetCreator
  from fairseq.data.iterators import GroupedEpochBatchIterator
  from fairseq.tasks import register_task
  from .pair_denoising import PairedDenoisingTask
label_desc: Use image node_id 9 for calling the SpeechTextJointDenoisingPreTask obj's underlying member method code with example usage: obj.load_dataset(split, epoch, combine) and returns: None,  src_dict, None,  tgt_dict