class_docstr: Extract answer and create answer start and end positions in characters from subtoken positions.
class_docstr_tok: ["Extract","answer","and","create","answer","start","and","end","positions","in","characters","from","subtoken","positions","."]
code: def __call__(
      self,
      answers_start_batch,
      answers_end_batch,
      contexts_batch,
      subtok2chars_batch,
      subtokens_batch,
      ind_batch,
      *args,
      **kwargs,
  ):
      answers = []
      starts = []
      ends = []
      for (
          answer_st,
          answer_end,
          context_list,
          sub2c_list,
          subtokens_list,
          ind,
      ) in zip(
          answers_start_batch,
          answers_end_batch,
          contexts_batch,
          subtok2chars_batch,
          subtokens_batch,
          ind_batch,
      ):
          sub2c = sub2c_list[ind]
          subtok = subtokens_list[ind][answer_end]
          context = context_list[ind]
          # CLS token is no_answer token
          if answer_st == 0 or answer_end == 0:
              answers += [""]
              starts += [-1]
              ends += [-1]
          else:
              st = self.get_char_position(sub2c, answer_st)
              end = self.get_char_position(sub2c, answer_end)
  
              subtok = subtok[2:] if subtok.startswith("##") else subtok
              answer = context[st : end + len(subtok)]
              answers += [answer]
              starts += [st]
              ends += [ends]
      return answers, starts, ends
  
file_path: DeepPavlov/deeppavlov/models/preprocessors/squad_preprocessor.py
imports: import bisect
  from logging import getLogger
  from typing import List, Dict
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.component import Component
label_desc: Use image node_id 2 for calling the SquadBertAnsPostprocessor obj's underlying member method code with example usage: obj.__call__(answers_start_batch, answers_end_batch, contexts_batch, subtok2chars_batch, subtokens_batch, ind_batch) and returns: answers,  starts,  ends