class_docstr: Base class for QA
class_docstr_tok: ["Base","class","for","QA"]
docstr: expand answer to include more of the context
docstr_tok: ["expand","answer","to","include","more","of","the","context"]
code: def _expand_answer(self, answer):
      """
      expand answer to include more of the context
      """
      full_abs = answer["context"]
      bert_ans = answer["answer"]
      split_abs = full_abs.split(bert_ans)
      sent_beginning = split_abs[0][split_abs[0].rfind(".") + 1 :]
      if len(split_abs) == 1:
          sent_end_pos = len(full_abs)
          sent_end = ""
      else:
          sent_end_pos = split_abs[1].find(". ") + 1
          if sent_end_pos == 0:
              sent_end = split_abs[1]
          else:
              sent_end = split_abs[1][:sent_end_pos]
  
      answer["full_answer"] = sent_beginning + bert_ans + sent_end
      answer["full_answer"] = answer["full_answer"].strip()
      answer["sentence_beginning"] = sent_beginning
      answer["sentence_end"] = sent_end
      return answer
  
imports: from transformers import AutoModelForQuestionAnswering, AutoTokenizer, TFAutoModelForQuestionAnswering
  from whoosh import index, qparser
  from whoosh.fields import *
  from whoosh.qparser import QueryParser
  from ...None import utils
  from ...imports import *
  from ...torch_base import TorchBase
  from ..None import preprocessor
  from ..None import textutils
  from itertools import chain, zip_longest
label_desc: Use image node_id 6 for calling the ExtractiveQABase obj's underlying member method code with example usage: obj._expand_answer(answer) and returns: answer