docstr: Load a dataset split. Seed and noiser are only used for loading train
  data, not eval data.
docstr_tok: ["Load","a","dataset","split",".","Seed","and","noiser","are","only","used","for","loading","train","data",",","not","eval","data","."]
code: def load_dataset(
      self,
      split,
      src_bin_path,
      tgt_bin_path,
      seed=None,
      use_noiser=False,
  ):
      """
      Load a dataset split. Seed and noiser are only used for loading train
      data, not eval data.
      """
      (
          parallel_dataset,
          src_dataset,
          tgt_dataset,
      ) = data_utils.load_parallel_dataset(
          source_lang=self.source_lang,
          target_lang=self.target_lang,
          src_bin_path=src_bin_path,
          tgt_bin_path=tgt_bin_path,
          source_dictionary=self.source_dictionary,
          target_dictionary=self.target_dictionary,
          split=split,
          remove_eos_from_source=not self.args.append_eos_to_source,
          append_eos_to_target=True,
          char_source_dict=None,
          log_verbose=self.args.log_verbose,
      )
  
      dataset_map = OrderedDict(
          [(f"{self.source_lang}-{self.target_lang}", parallel_dataset)]
      )
  
      monolingual_num_examples_limit = None
      if self.args.monolingual_ratio is not None:
          monolingual_num_examples_limit = int(
              self.args.monolingual_ratio * len(parallel_dataset)
          )
      if use_noiser:
          if getattr(self.args, "denoising_source_parallel", False):
              dataset_map[
                  (f"{self.source_lang}-{self.source_lang}")
              ] = weighted_data.WeightedLanguagePairDataset(
                  src=noising.NoisingDataset(
                      src_dataset=src_dataset,
                      src_dict=self.source_dictionary,
                      seed=seed,
                      noiser=self.source_noiser,
                  ),
                  tgt=src_dataset,
                  src_sizes=src_dataset.sizes,
                  src_dict=self.source_dictionary,
                  remove_eos_from_source=not self.args.append_eos_to_source,
                  append_eos_to_target=True,
              )
          if getattr(self.args, "denoising_target_parallel", False):
              dataset_map[
                  (f"{self.target_lang}-{self.target_lang}")
              ] = weighted_data.WeightedLanguagePairDataset(
                  src=noising.NoisingDataset(
                      src_dataset=tgt_dataset,
                      src_dict=self.target_dictionary,
                      seed=seed,
                      noiser=self.target_noiser,
                  ),
                  tgt=tgt_dataset,
                  src_sizes=tgt_dataset.sizes,
                  src_dict=self.target_dictionary,
                  remove_eos_from_source=not self.args.append_eos_to_source,
                  append_eos_to_target=True,
              )
  
          if getattr(self.args, "denoising_source_mono", False):
              source_mono_dataset = self.load_monolingual_dataset(
                  bin_path=self.args.train_mono_source_binary_path,
                  is_source=True,
                  num_examples_limit=monolingual_num_examples_limit,
              )
              dataset_map[
                  (
                      f"{self.source_lang}-{self.source_lang}_"
                      f"{constants.MONOLINGUAL_DATA_IDENTIFIER}"
                  )
              ] = weighted_data.WeightedLanguagePairDataset(
                  src=noising.NoisingDataset(
                      src_dataset=source_mono_dataset,
                      src_dict=self.source_dictionary,
                      seed=seed,
                      noiser=self.source_noiser,
                  ),
                  tgt=source_mono_dataset,
                  src_sizes=source_mono_dataset.sizes,
                  src_dict=self.source_dictionary,
                  remove_eos_from_source=not self.args.append_eos_to_source,
                  append_eos_to_target=True,
              )
          if getattr(self.args, "denoising_target_mono", False):
              target_mono_dataset = self.load_monolingual_dataset(
                  bin_path=self.args.train_mono_target_binary_path,
                  is_source=False,
                  num_examples_limit=monolingual_num_examples_limit,
              )
              dataset_map[
                  (
                      f"{self.target_lang}-{self.target_lang}_"
                      f"{constants.MONOLINGUAL_DATA_IDENTIFIER}"
                  )
              ] = weighted_data.WeightedLanguagePairDataset(
                  src=noising.NoisingDataset(
                      src_dataset=target_mono_dataset,
                      src_dict=self.target_dictionary,
                      seed=seed,
                      noiser=self.target_noiser,
                  ),
                  tgt=target_mono_dataset,
                  src_sizes=target_mono_dataset.sizes,
                  src_dict=self.target_dictionary,
                  remove_eos_from_source=not self.args.append_eos_to_source,
                  append_eos_to_target=True,
              )
  
      # print before loading RoundRobinZipDatasets to help catch any bugs
      for dataset_key, dataset in dataset_map.items():
          print(
              f"| {split}: {dataset_key} {len(dataset)} examples in dataset"
          )
  
      self.datasets[split] = RoundRobinZipDatasets(dataset_map)
      print(
          f"| {split} {len(self.datasets[split])} examples in RoundRobinZipDatasets"
      )
  
      if self.args.log_verbose:
          print("Finished loading dataset", flush=True)
  
      print(f"| {split} {len(self.datasets[split])} datasets")
  
file_path: translate/pytorch_translate/tasks/denoising_autoencoder_task.py
imports: from collections import OrderedDict
  from fairseq import models
  from fairseq.data import noising, RoundRobinZipDatasets
  from fairseq.tasks import register_task
  from pytorch_translate import constants, utils
  from pytorch_translate.data import utils, weighted_data
  from pytorch_translate.semi_supervised import SemiSupervisedModel
  from pytorch_translate.tasks.pytorch_translate_task import PytorchTranslateTask
  from pytorch_translate.tasks.semi_supervised_task import PytorchTranslateSemiSupervised
label_desc: Use image node_id 3 for calling the PytorchTranslateDenoisingAutoencoder obj's underlying member method code with example usage: obj.load_dataset(split, src_bin_path, tgt_bin_path, seed, use_noiser) without return types