def _annotate_short_answer(predict_fn, question_tokens, context_tokens):
  """Applies the model to the (question, contexts) and returns long answer.

  Args:
    predict_fn: Predictor from tf.contrib.predictor.from_saved_model.
    question_tokens: List of strings.
    context_tokens: List of strings.

  Returns:
    long_answer_idx: integer.
    long_answer_score: float.
  """
  # The inputs are tokenized unlike in the long answer case, since the goal
  # is to pick out a particular span in a single context.
  inputs = {"question": question_tokens, "context": context_tokens}
  outputs = predict_fn(inputs)
  start_idx = outputs["start_idx"]
  end_idx = outputs["end_idx"]
  short_answer_score = outputs["score"]

  return start_idx, end_idx, float(short_answer_score)
Applies the model to the (question, contexts) and returns long answer.

  Args:
    predict_fn: Predictor from tf.contrib.predictor.from_saved_model.
    question_tokens: List of strings.
    context_tokens: List of strings.

  Returns:
    long_answer_idx: integer.
    long_answer_score: float.
  
language/question_answering/decatt_docreader/experiments/nq_export_scorer.py