class_docstr: transform and retrieve features of RESample
docstr: delete word of given indices in sentence
  
  :param string field: field to be operated on
  :param list indices: a list of index to be deleted
  
  :return dict: contains 'token', 'subj' ,'obj'  keys
docstr_tok: ["delete","word","of","given","indices","in","sentence",":","param","string","field",":","field","to","be","operated","on",":","param","list","indices",":","a","list","of","index","to","be","deleted",":","return","dict",":","contains","'token","'",",","'subj","'",",","'obj","'","keys"]
code: def delete_field_at_indices(self, field, indices):
      r"""
      delete word of given indices in sentence
  
      :param string field: field to be operated on
      :param list indices: a list of index to be deleted
  
      :return dict: contains 'token', 'subj' ,'obj'  keys
  
      """
      sample = self.clone(self)
      text = self.data["x"]
  
      for idx in indices:
          if (
              type(idx).__name__ == "int"
              and idx >= len(text)
              or type(idx).__name__ == "list"
              and idx[-1] > len(text)
          ):
              print("index exceeds length")
              return sample
  
      sh, st = self.data["subj"][0], self.data["subj"][1]
      oh, ot = self.data["obj"][0], self.data["obj"][1]
      sub, ob, subj_to_delete, obj_to_delete, delete = (
          [],
          [],
          [],
          [],
          [],
      )
  
      for idx in indices:
          if type(idx).__name__ == "list":
              sub += range(idx[0], idx[1])
              ob += range(idx[0], idx[1])
              delete += range(idx[0], idx[1])
          else:
              sub.append(idx)
              ob.append(idx)
              delete.append(idx)
          subj_to_delete = [i for i in range(sh, st + 1) if i in sub]
          obj_to_delete = [i for i in range(oh, ot + 1) if i in ob]
      new_text, new_data = [], {}
      delete = list(set(delete))
  
      if len(subj_to_delete) > 0 or len(obj_to_delete) > 0:
          print("You should not delete entity")
          return sample
      subj_before, obj_before = 0, 0
  
      for idx in delete:
          if idx < sh:
              subj_before += 1
          if idx < oh:
              obj_before += 1
      for idx in range(len(text)):
          if idx not in delete:
              new_text.append(text[idx])
      (
          new_data["x"],
          new_data["subj"],
          new_data["obj"],
          new_data["y"],
      ) = (
          new_text,
          [sh - subj_before, st - subj_before],
          [oh - obj_before, ot - obj_before],
          self.data["y"],
      )
      sample.load(new_data)
  
      return sample
  
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 11 for calling the RESample obj's underlying member method code with example usage: obj.delete_field_at_indices(field, indices) and returns: sample, sample, sample