class_docstr: transform and retrieve features of RESample
docstr: Convert data dict which contains essential information to SASample.
  
  :params: dict data: contains 'token', 'subj' ,'obj', 'relation' keys.
docstr_tok: ["Convert","data","dict","which","contains","essential","information","to","SASample",".",":","params",":","dict","data",":","contains","'token","'",",","'subj","'",",","'obj","'",",","'relation","'","keys","."]
code: def load(self, data):
      r"""
      Convert data dict which contains essential information to SASample.
  
      :params: dict data: contains 'token', 'subj' ,'obj', 'relation' keys.
  
      """
      if type(data).__name__ == "dict":
          if "token" in data.keys():
              self.subj = [data["subj_start"], data["subj_end"]]
              self.obj = [data["obj_start"], data["obj_end"]]
              self.y = data["relation"]
              data = data["token"]
          else:
              self.subj = data["subj"]
              self.obj = data["obj"]
              self.y = data["y"]
              self.data = data
              data = data["x"]
  
      self.x = TextField(data)
      if not self.is_legal():
          raise ValueError(
              "Data sample {0} is not legal, "
              "entity or relation label is not in line.".format(
                  self.data
              )
          )
  
      for i in range(self.subj[0], self.subj[1] + 1):
          self.x.set_mask(i, TASK_MASK)
      for i in range(self.obj[0], self.obj[1] + 1):
          self.x.set_mask(i, TASK_MASK)
  
imports: import random
  import copy
  from .sample import Sample
  from ..field import TextField
  from ....common.settings import TASK_MASK
label_desc: Use image node_id 6 for calling the RESample obj's underlying member method code with example usage: obj.load(data) without return types