class_docstr: Any iterable of (label, text_input) pairs qualifies as a ``Dataset``.
class_docstr_tok: ["Any","iterable","of","(","label",",","text_input",")","pairs","qualifies","as","a","``","Dataset","``","."]
docstr: Loads json object and prepares it as a Dataset.
  
  Support two formats input,
  Example::
  
  1. {'x': [
                'The robustness of deep neural networks has received
                much attention recently',
                'We focus on certified robustness of smoothed classifiers
                in this work',
                ...,
                'our approach exceeds the state-of-the-art.'
                ],
          'y': [
                'neural',
                'positive',
                ...,
                'positive'
                ]}
      2. [
          {'x': 'The robustness of deep neural networks has received
          much attention recently', 'y': 'neural'},
          {'x': 'We focus on certified robustness of smoothed classifiers
          in this work', 'y': 'positive'},
          ...,
          {'x': 'our approach exceeds the state-of-the-art.',
          'y': 'positive'}
          ]
  :param list|dict dataset:
  :return:
docstr_tok: ["Loads","json","object","and","prepares","it","as","a","Dataset",".","Support","two","formats","input",",","Example",":",":","1",".","{","'","x","'",":","[","'The","robustness","of","deep","neural","networks","has","received","much","attention","recently","'",",","'We","focus","on","certified","robustness","of","smoothed","classifiers","in","this","work","'",",","...",",","'our","approach","exceeds","the","state-of-the-art",".","'","]",",","'","y","'",":","[","'neural","'",",","'positive","'",",","...",",","'positive'","]","}","2",".","[","{","'","x","'",":","'The","robustness","of","deep","neural","networks","has","received","much","attention","recently","'",",","'","y","'",":","'neural","'","}",",","{","'","x","'",":","'We","focus","on","certified","robustness","of","smoothed","classifiers","in","this","work","'",",","'","y","'",":","'positive","'","}",",","...",",","{","'","x","'",":","'our","approach","exceeds","the","state-of-the-art",".","'",",","'","y","'",":","'positive","'","}","]",":","param","list|dict","dataset",":",":","return",":"]
code: def load(self, dataset):
      r"""
      Loads json object and prepares it as a Dataset.
  
      Support two formats input,
      Example::
  
      1. {'x': [
                    'The robustness of deep neural networks has received
                    much attention recently',
                    'We focus on certified robustness of smoothed classifiers
                    in this work',
                    ...,
                    'our approach exceeds the state-of-the-art.'
                    ],
              'y': [
                    'neural',
                    'positive',
                    ...,
                    'positive'
                    ]}
          2. [
              {'x': 'The robustness of deep neural networks has received
              much attention recently', 'y': 'neural'},
              {'x': 'We focus on certified robustness of smoothed classifiers
              in this work', 'y': 'positive'},
              ...,
              {'x': 'our approach exceeds the state-of-the-art.',
              'y': 'positive'}
              ]
      :param list|dict dataset:
      :return:
  
      """
      sample_id = 0
  
      if isinstance(dataset, (Sample, CnSample, list, dict)):
          logger.info("******Start load!******")
  
          success_count = 0
          norm_samples = self.norm_input(dataset)
  
          for single_sample in tqdm(norm_samples):
              success_count += self.append(single_sample, sample_id)
              sample_id += 1
  
          logger.info(
              "{0} in total, {1} were loaded successful.".format(
                  len(norm_samples), success_count
              )
          )
          logger.info("******Finish load!******")
      else:
          raise ValueError(
              "Cant load dataset type {0}".format(type(dataset))
          )
  
imports: from tqdm import tqdm
  from ...common.utils import logger
  from ..component.sample import Sample, CnSample
  from ...common.utils.load import task_class_load
  from ...common.settings import SAMPLE_PATH, NLP_TASK_MAP
  from ...common.utils.file_io import read_csv, read_json, save_csv, save_json
label_desc: Use image node_id 10 for calling the Dataset obj's underlying member method code with example usage: obj.load(dataset) without return types