class_docstr: MRC Sample class to hold the mrc data info and provide atomic operations.
docstr: Get word-level positions of answers
  
  :param dict ans: answers dict with character position and text
  :param list spans: the start idx and end idx of tokens
docstr_tok: ["Get","word-level","positions","of","answers",":","param","dict","ans",":","answers","dict","with","character","position","and","text",":","param","list","spans",":","the","start","idx","and","end","idx","of","tokens"]
code: def load_answers(self, ans, spans):
      r"""
      Get word-level positions of answers
  
      :param dict ans: answers dict with character position and text
      :param list spans: the start idx and end idx of tokens
  
      """
      answers = [answer["text"] for answer in ans]
      span_starts = [answer["answer_start"] for answer in ans]
      span_ends = [
          start + len(answer)
          for start, answer in zip(span_starts, answers)
      ]
      for answer, sos, eos in zip(answers, span_starts, span_ends):
          y1, y2 = self.get_answer_position(spans, sos, eos)
          for i in range(y1, y2 + 1):
              self.context.set_mask(i, 1)
          self.answers.append({"text": answer, "start": y1, "end": y2})
  
imports: from .cnsample import CnSample
  from ..field import Field, CnTextField
  from ....common.utils.list_op import normalize_scope
  from ....common.preprocess.nltk_res_load import ModelManager
  from ....common.settings import *
  from nltk.stem.lancaster import LancasterStemmer
  from copy import deepcopy
label_desc: Use image node_id 6 for calling the MRCCnSample obj's underlying member method code with example usage: obj.load_answers(ans, spans) without return types