code: def load_dataset_from_text(
      self,
      split: str,
      source_text_file: str,
      target_text_file: str,
      append_eos: Optional[bool] = False,
      reverse_source: Optional[bool] = True,
  ):
      append_bos = getattr(self.args, "append_bos", False)
      if self.char_target_dict is not None:
          dst_dataset = char_data.InMemoryNumpyWordCharDataset()
          dst_dataset.parse(
              path=target_text_file,
              word_dict=self.target_dictionary,
              char_dict=self.char_target_dict,
              reverse_order=False,
              append_eos=True,
          )
      else:
          dst_dataset = data.IndexedRawTextDataset(
              path=target_text_file,
              dictionary=self.target_dictionary,
              # We always append EOS to the target sentence since we still want
              # the model to output an indication the sentence has finished, even
              # if we don't append the EOS symbol to the source sentence
              # (to prevent the model from misaligning UNKs or other words
              # to the frequently occurring EOS).
              append_eos=True,
              # We don't reverse the order of the target sentence, since
              # even if the source sentence is fed to the model backwards,
              # we still want the model to start outputting from the first word.
              reverse_order=False,
          )
  
      if self.char_source_dict is not None:
          src_dataset = char_data.InMemoryNumpyWordCharDataset()
          src_dataset.parse(
              path=source_text_file,
              word_dict=self.source_dictionary,
              char_dict=self.char_source_dict,
              reverse_order=reverse_source,
              append_eos=append_eos,
          )
          char_data_class = (
              char_data.LanguagePairCharDataset
              if self.char_target_dict is not None
              else char_data.LanguagePairSourceCharDataset
          )
          self.datasets[split] = char_data_class(
              src=src_dataset,
              src_sizes=src_dataset.sizes,
              src_dict=self.source_dictionary,
              tgt=dst_dataset,
              tgt_sizes=dst_dataset.sizes,
              tgt_dict=self.target_dictionary,
          )
      else:
          src_dataset = data.IndexedRawTextDataset(
              path=source_text_file,
              dictionary=self.source_dictionary,
              append_eos=append_eos,
              reverse_order=reverse_source,
          )
          self.datasets[split] = data.LanguagePairDataset(
              src=src_dataset,
              src_sizes=src_dataset.sizes,
              src_dict=self.source_dictionary,
              tgt=dst_dataset,
              tgt_sizes=dst_dataset.sizes,
              tgt_dict=self.target_dictionary,
              left_pad_source=False,
              append_bos=append_bos,
          )
  
      print(f"| {split} {len(self.datasets[split])} examples")
  
imports: import os
  from collections import OrderedDict
  from typing import Dict, List, Optional, Tuple
  import numpy
  from fairseq import data, options
  from fairseq.data import ConcatDataset, LanguagePairDataset, NoisingDataset
  from fairseq.data.multi_corpus_sampled_dataset import MultiCorpusSampledDataset
  from fairseq.data.noising import UnsupervisedMTNoising
  from fairseq.tasks import LegacyFairseqTask, register_task
  from pytorch_translate import constants, utils
  from pytorch_translate.data import char_data, data, dictionary, utils, weighted_data
  from pytorch_translate.data.language_pair_upsampling_dataset import LanguagePairUpsamplingDataset
  from pytorch_translate.research.multisource import multisource_data
label_desc: Use image node_id 10 for calling the PytorchTranslateTask obj's underlying member method code with example usage: obj.load_dataset_from_text(split, source_text_file, target_text_file, append_eos, reverse_source) without return types