class_docstr: Abstract data loader.
class_docstr_tok: ["Abstract","data","loader","."]
code: def _load_data(self, fold, domains):
      # load up the ontology
      ontologies = {}
      for section in domains:
          fn = os.path.join(self.dpath, section + ".onto.json")
          with PathManager.open(fn, "r") as f:
              ontologies.update(json.load(f))
  
      chunks = []
      for section in domains:
          with PathManager.open(
              os.path.join(self.dpath, section + ".json")
          ) as f:
              subset = pd.read_json(f)
          subset["domain"] = section
          chunks.append(subset)
      chunks = pd.concat(chunks, axis=0)
      # deterministic shuffle data for splits
      chunks = chunks.sample(frac=1.0, random_state=42)
      split_size = len(chunks) // 10
      if fold == "train":
          chunks = chunks[: split_size * 8]
      elif fold == "valid":
          chunks = chunks[split_size * 8 : split_size * 9]
      elif fold == "test":
          chunks = chunks[split_size * 9 :]
      return chunks, ontologies
  
imports: from parlai.core.params import ParlaiParser
  import os
  import pandas
  from collections import Counter
  from parlai.core.opt import Opt
  import parlai.core.tod.tod_core
  from parlai.utils.misc import warn_once
  import json
  from typing import Optional
  from parlai.utils.data import DatatypeHelper
  from parlai.utils.io import PathManager
  import parlai.tasks.taskmaster2.build
  import parlai.core.tod.tod_agents
label_desc: Use image node_id 3 for calling the Taskmaster2Parser obj's underlying member method code with example usage: obj._load_data(fold, domains) and returns: chunks,  ontologies