class_docstr: Abstract base class for QA Datasets with common utility methods 
class_docstr_tok: ["Abstract","base","class","for","QA","Datasets","with","common","utility","methods"]
docstr: Returns tokenized answer spans that better match the annotated answer 
docstr_tok: ["Returns","tokenized","answer","spans","that","better","match","the","annotated","answer"]
code: def improve_answer_span(
      doc_tokens: List[str],
      input_start: int,
      input_end: int,
      tokenizer: object,
      orig_answer_text: str,
  ):
      """Returns tokenized answer spans that better match the annotated answer"""
  
      tok_answer_text = " ".join(
          tokenizer.text_to_tokens(orig_answer_text)
      )
  
      for new_start in range(input_start, input_end + 1):
          for new_end in range(input_end, new_start - 1, -1):
              text_span = " ".join(
                  doc_tokens[new_start : (new_end + 1)]
              )
              if text_span == tok_answer_text:
                  return (new_start, new_end)
  
      return (input_start, input_end)
  
imports: import collections
  import pickle
  from functools import lru_cache
  from typing import List
  import psutil
  import torch
  from nemo.collections.nlp.data.data_utils import is_whitespace
  from nemo.collections.nlp.data.question_answering.data_processor.qa_processing import EVALUATION_MODE, INFERENCE_MODE, TRAINING_MODE
  from nemo.core.classes import Dataset
  from nemo.utils import logging
label_desc: Use image node_id 14 for calling the QADataset obj's underlying member method code with example usage: obj.improve_answer_span(doc_tokens, input_start, input_end, tokenizer, orig_answer_text) and returns: input_start,  input_end, new_start,  new_end