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 __init__(self, opt, shared=None):
      super().__init__(opt)
      opt["fn"] = "self-dialogs.json"
  
      if shared and "convos" in shared:
          # another instance was set up already, just reference its data
          self.convos = shared["convos"]
          self.num_ex = shared["num_ex"]
      else:
          # need to set up data from scratch
          data_path = tm_utils._path(opt)
          self.num_ex = 0
          self._setup_data(data_path, opt)
      self.reset()
  
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 1 to create a new SelfDialogueSegmentTeacher object from inherited base classes: FixedDialogTeacher with example: obj = SelfDialogueSegmentTeacher(opt, shared)