def get_candidate_type_and_position(json_dict, idx):
  """Returns type and position info for the candidate at the given index."""
  if idx == -1:
    return "[NoLongAnswer]"
  else:
    # Gets the 'type_and_position' for this candidate as added by
    # `add_candidate_types_and_positions`. Note that this key is not present
    # in the original TyDi QA corpus.
    return json_dict["passage_answer_candidates"][idx]["type_and_position"]
Returns type and position info for the candidate at the given index.
language/canine/tydiqa/preproc.py