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

  Args:
    predict_fn: Predictor from tf.contrib.predictor.from_saved_model.
    question: string.
    contexts: List of strings.

  Returns:
    long_answer_idx: integer.
    long_answer_score: float.
  """
  # The inputs are not tokenized here because there are multiple contexts.
  inputs = {"question": question, "context": contexts}

  outputs = predict_fn(inputs)
  long_answer_idx = outputs["idx"]
  long_answer_score = outputs["score"]

  return long_answer_idx, float(long_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: string.
    contexts: List of strings.

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