class_docstr: ReDial Teacher.
class_docstr_tok: ["ReDial","Teacher","."]
code: def _setup_data(self, data_path):
      train_path = os.path.join(data_path, "train_data.jsonl")
      test_path = os.path.join(data_path, "test_data.jsonl")
      # The test data has 1341 episodes. Making valid this size gives
      # about 80/10/10 train/test/valid split
      test_set_episodes = 1341
      if self.datatype.startswith("test"):
          unmerged_episodes = self.get_data_from_file(test_path)
      elif self.datatype.startswith("valid"):
          unmerged_episodes = self.get_data_from_file(train_path)
          unmerged_episodes = unmerged_episodes[:test_set_episodes]
      else:
          unmerged_episodes = self.get_data_from_file(train_path)
          unmerged_episodes = unmerged_episodes[test_set_episodes:]
  
      # some speakers speak multiple times in a row.
      for unmerged_episode in unmerged_episodes:
          episode = []
          prev_speaker = None
          for message in unmerged_episode["messages"]:
              curr_speaker = message["senderWorkerId"]
              text = replace_movie_ids(
                  message["text"], self.title_id_map
              )
              if curr_speaker == prev_speaker:
                  episode[-1] = episode[-1] + " " + text
              else:
                  episode.append(text)
                  prev_speaker = curr_speaker
          self.episodes.append(episode)
  
imports: from parlai.core.teachers import FixedDialogTeacher
  from parlai.utils.io import PathManager
  from .build import build
  import os
  import json
  import re
  import csv
label_desc: Use image node_id 3 for calling the ReDialTeacher obj's underlying member method code with example usage: obj._setup_data(data_path) without return types