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: Find distance between doc_span and answer_span to determine if doc_span is likely to be useful for the answer
  Helper function to filter out doc_spans that may not be helpful
  
  Args:
      doc_span
      tok_start_position: start position of answer in document
      tok_end_position: end position of answer in document
  
  Returns:
      average distance of doc_span to answer
docstr_tok: ["Find","distance","between","doc_span","and","answer_span","to","determine","if","doc_span","is","likely","to","be","useful","for","the","answer","Helper","function","to","filter","out","doc_spans","that","may","not","be","helpful","Args",":","doc_span","tok_start_position",":","start","position","of","answer","in","document","tok_end_position",":","end","position","of","answer","in","document","Returns",":","average","distance","of","doc_span","to","answer"]
code: def get_average_dist_to_tok_start_and_end(
      doc_span, tok_start_position, tok_end_position
  ):
      """
      Find distance between doc_span and answer_span to determine if doc_span is likely to be useful for the answer
      Helper function to filter out doc_spans that may not be helpful
  
      Args:
          doc_span
          tok_start_position: start position of answer in document
          tok_end_position: end position of answer in document
  
      Returns:
          average distance of doc_span to answer
      """
  
      center_answer = (tok_start_position + tok_end_position) // 2
      dist_to_start = abs(doc_span.start - center_answer)
      dist_to_end = abs(
          doc_span.start + doc_span.length - 1 - center_answer
      )
  
      return (dist_to_start + dist_to_end) // 2
  
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 10 for calling the QADataset obj's underlying member method code with example usage: obj.get_average_dist_to_tok_start_and_end(doc_span, tok_start_position, tok_end_position) and returns: unknown