class_docstr: Teacher for written two-person dialogues with labels being relevant/useful parts in
  the input sentence.
  
  The different datatypes of the labels within the data have also been encoded as
  `label_types`
class_docstr_tok: ["Teacher","for","written","two-person","dialogues","with","labels","being","relevant\/useful","parts","in","the","input","sentence",".","The","different","datatypes","of","the","labels","within","the","data","have","also","been","encoded","as","`","label_types","`"]
code: def _setup_data(self, data_path, opt):
      print("loading: " + data_path)
      with PathManager.open(data_path) as data_file:
          self.convos = json.load(data_file)
  
      # Filter out instances which do not have "segment" in them
      convos_updated = []
      for convo in self.convos:
          updated_dialog = []
          for i in range(len(convo["utterances"])):
              if "segments" in convo["utterances"][i]:
                  updated_dialog += [convo["utterances"][i]]
          convo["utterances"] = updated_dialog
          if convo["utterances"]:
              convos_updated += [convo]
              self.num_ex += len(convo["utterances"])
      self.convos = convos_updated
  
imports: from parlai.core.params import ParlaiParser
  import os
  import pandas
  from parlai.core.opt import Opt
  import parlai.core.tod.tod_core
  from typing import Optional
  from parlai.utils.data import DatatypeHelper
  from parlai.utils.io import PathManager
  import parlai.tasks.taskmaster.build
  import parlai.core.tod.tod_agents
  from parlai.core.teachers import FixedDialogTeacher
  from .None import tm_utils
  import json
label_desc: Use image node_id 5 for calling the SelfDialogueSegmentTeacher obj's underlying member method code with example usage: obj._setup_data(data_path, opt) without return types