def add_candidate_types_and_positions(json_dict, max_position):
  """Adds type and position info to each candidate in the document."""
  count = 0
  for cand in json_dict["passage_answer_candidates"]:
    if count < max_position:
      count += 1
    cand["type_and_position"] = "[Paragraph=%d]" % count
Adds type and position info to each candidate in the document.
language/canine/tydiqa/preproc.py