class_docstr: WSDSample Class
class_docstr_tok: ["WSDSample","Class"]
docstr: insert word before given indices in sentence
  
  :param string field: field to be operated on
  :param list indices: a list of index to be inserted
  :param list items: list of items to be inserted
  :param list pos_list: default none, list of given pos for items
  :param list lemma_list: default none, list of given lemma for items
  :return WSDSample sample: a modified sample
docstr_tok: ["insert","word","before","given","indices","in","sentence",":","param","string","field",":","field","to","be","operated","on",":","param","list","indices",":","a","list","of","index","to","be","inserted",":","param","list","items",":","list","of","items","to","be","inserted",":","param","list","pos_list",":","default","none",",","list","of","given","pos","for","items",":","param","list","lemma_list",":","default","none",",","list","of","given","lemma","for","items",":","return","WSDSample","sample",":","a","modified","sample"]
code: def insert_field_before_indices(
      self, field, indices, items, pos_list=None, lemma_list=None
  ):
      r"""insert word before given indices in sentence
  
      :param string field: field to be operated on
      :param list indices: a list of index to be inserted
      :param list items: list of items to be inserted
      :param list pos_list: default none, list of given pos for items
      :param list lemma_list: default none, list of given lemma for items
      :return WSDSample sample: a modified sample
  
      """
      self.check_indices_and_items(indices, items)
      sample = self.clone(self)
      sample = super(WSDSample, sample).insert_field_before_indices(
          field, indices, items
      )
  
      # insert corresponding pos
      if pos_list is None:
          new_pos = sample.tag_words(items)
      else:
          new_pos = pos_list
      sample = super(WSDSample, sample).insert_field_before_indices(
          "pos", indices, new_pos
      )
  
      # insert corresponding lemma
      if lemma_list is None:
          new_lemma = sample.get_lemma(items)
      else:
          new_lemma = lemma_list
      sample = super(WSDSample, sample).insert_field_before_indices(
          "lemma", indices, new_lemma
      )
      # adjust the position of the influenced instances
      targets = []
      for key, start, end, word, sense in sample.instance:
          offset_s = 0
          for i, idx in enumerate(indices):
              if idx <= start:
                  if isinstance(items[i], str):
                      offset_s += 1
                  else:
                      offset_s += len(items[i])
              else:
                  break
          # reconstruct instances
          offset_e = offset_s
          targets.append(
              [key, start + offset_s, end + offset_e, word, sense]
          )
      setattr(sample, "instance", ListField(targets))
      return sample
  
imports: from .sample import Sample
  from ..field import TextField, ListField
  import json
  from ....common.settings import TASK_MASK, PUNC
  import nltk
label_desc: Use image node_id 15 for calling the WSDSample obj's underlying member method code with example usage: obj.insert_field_before_indices(field, indices, items, pos_list, lemma_list) and returns: sample