class_docstr: PyTorchTranslateMultilingualTranslationTask is eventually subclasses
  fairseq.tasks.MultilingualTranslationTask. The major differences are-
  - There is no --data folder containing data binaries and vocabularies,
    instead we use paths from --vocabulary, --multilingual-*-text-file and
    --multilingual-*-binary-path
  - loss_weights is used to weigh losses from different datasets differently.
    This is achieved by using pytorch_translate's WeightedLanguagePairDataset
  - The dictionaries are instances of pytorch_translate's Dictionary class
class_docstr_tok: ["PyTorchTranslateMultilingualTranslationTask","is","eventually","subclasses","fairseq.tasks.MultilingualTranslationTask",".","The","major","differences","are-","-","There","is","no","--","data","folder","containing","data","binaries","and","vocabularies",",","instead","we","use","paths","from","--","vocabulary",",","--","multilingual-","*","-text-file","and","--","multilingual-","*","-binary-path","-","loss_weights","is","used","to","weigh","losses","from","different","datasets","differently",".","This","is","achieved","by","using","pytorch_translate","'s","WeightedLanguagePairDataset","-","The","dictionaries","are","instances","of","pytorch_translate","'s","Dictionary","class"]
docstr: Load a dataset split.
docstr_tok: ["Load","a","dataset","split","."]
code: def load_dataset(self, split, **kwargs):
      """Load a dataset split."""
  
      lang_pair_to_datasets = {}
  
      binary_path_arg = (
          "--multilingual-train-binary-path"
          if split == "train"
          else "--multilingual-eval-binary-path"
      )
      binary_path_value = (
          self.args.multilingual_train_binary_path
          if split == "train"
          else self.args.multilingual_eval_binary_path
      )
  
      format_warning = (
          f"{binary_path_arg} has to be in the format "
          " src_lang-tgt_lang:src_dataset_path,tgt_dataset_path"
      )
  
      for path_config in binary_path_value:
          # path_config: str
          # in the format "src_lang-tgt_lang:src_dataset_path,tgt_dataset_path"
          assert ":" in path_config, format_warning
          lang_pair, dataset_paths = path_config.split(":")
  
          assert "-" in lang_pair, format_warning
  
          assert "," in dataset_paths, format_warning
          src_dataset_path, tgt_dataset_path = dataset_paths.split(",")
  
          lang_pair_to_datasets[lang_pair] = (
              src_dataset_path,
              tgt_dataset_path,
          )
  
      for lang_pair in self.args.lang_pairs:
          assert (
              lang_pair in lang_pair_to_datasets
          ), "Not all language pairs have dataset binary paths specified!"
  
      datasets = {}
      for lang_pair in self.args.lang_pairs:
          src, tgt = lang_pair.split("-")
          src_bin_path, tgt_bin_path = lang_pair_to_datasets[lang_pair]
          corpus = pytorch_translate_data.ParallelCorpusConfig(
              source=pytorch_translate_data.CorpusConfig(
                  dialect=src, data_file=src_bin_path
              ),
              target=pytorch_translate_data.CorpusConfig(
                  dialect=tgt, data_file=tgt_bin_path
              ),
          )
          if self.args.log_verbose:
              print(
                  "Starting to load binarized data files.", flush=True
              )
  
          data_utils.validate_corpus_exists(corpus=corpus, split=split)
  
          tgt_dataset = pytorch_translate_data.InMemoryIndexedDataset.create_from_file(
              corpus.target.data_file
          )
          src_dataset = pytorch_translate_data.InMemoryIndexedDataset.create_from_file(
              corpus.source.data_file
          )
          datasets[
              lang_pair
          ] = weighted_data.WeightedLanguagePairDataset(
              src=src_dataset,
              src_sizes=src_dataset.sizes,
              src_dict=self.dicts[src],
              tgt=tgt_dataset,
              tgt_sizes=tgt_dataset.sizes,
              tgt_dict=self.dicts[tgt],
              weights=None,
              left_pad_source=False,
          )
      self.datasets[split] = RoundRobinZipDatasets(
          OrderedDict(
              [
                  (lang_pair, datasets[lang_pair])
                  for lang_pair in self.args.lang_pairs
              ]
          ),
          eval_key=None
          if self.training
          else f"{self.args.source_lang}-{self.args.target_lang}",
      )
  
      if self.args.log_verbose:
          print("Finished loading dataset", flush=True)
  
      print(f"| {split} {len(self.datasets[split])} examples")
  
file_path: translate/pytorch_translate/tasks/multilingual_task.py
imports: from collections import OrderedDict
  from fairseq import options
  from fairseq.data import RoundRobinZipDatasets
  from fairseq.tasks import register_task
  from pytorch_translate import constants
  from pytorch_translate.data import data, utils, weighted_data
  from pytorch_translate.tasks import utils
  from pytorch_translate.tasks.pytorch_translate_multi_task import PyTorchTranslateMultiTask
label_desc: Use image node_id 4 for calling the PyTorchTranslateMultilingualTranslationTask obj's underlying member method code with example usage: obj.load_dataset(split) without return types