class_docstr: Download data from https://rajpurkar.github.io/SQuAD-explorer/
  Will return tuples of (doc, question, answer, answer_start, has_answer)
class_docstr_tok: ["Download","data","from","https",":","\/\/rajpurkar.github.io\/SQuAD-explorer\/","Will","return","tuples","of","(","doc",",","question",",","answer",",","answer_start",",","has_answer",")"]
code: def process_squad_tsv(self, fname):
      if not fname:
          print("Empty file name!")
          return
  
      field_names = [
          "doc",
          "question",
          "answers",
          "answer_starts",
          "has_answer",
      ]
      tsv_file = SafeFileWrapper(
          get_absolute_path(fname), encoding="utf-8", errors="replace"
      )
      tsv = TSV(
          tsv_file,
          field_names=field_names,
          delimiter=self.delimiter,
          quoted=self.quoted,
          drop_incomplete_rows=True,
      )
  
      for id, row in enumerate(tsv):
          parts = (row[f] for f in field_names)
          doc, question, answers, answer_starts, has_answer = parts
          try:
              # if we have paraphrases for question
              question = json.loads(question)
              if isinstance(question, list):
                  question = choice(question)
          except ValueError:
              pass
          answers = json.loads(answers)
          answer_starts = json.loads(answer_starts)
  
          if has_answer != "True":
              answers = []
              answer_starts = []
  
          for piece_dict in _split_document(
              id,
              doc,
              question,
              answers,
              answer_starts,
              has_answer == "True",
              self.ignore_impossible,
              self.max_character_length,
              self.min_overlap,
          ):
              yield piece_dict
  
imports: import json
  import math
  from random import choice
  from typing import List, Optional
  from pytext.data.sources.data_source import DataSource, generator_property, JSONString, SafeFileWrapper
  from pytext.data.sources.tsv import TSV
  from pytext.utils.file_io import PathManager
  from pytext.utils.path import get_absolute_path
label_desc: Use image node_id 5 for calling the SquadDataSource obj's underlying member method code with example usage: obj.process_squad_tsv(fname) without return types