def answer_in_retrieval(retrieved_entities, answer_index):
  """Check for which batch elements an answer is retrieved."""
  retrieved_index = batch_gather(answer_index, retrieved_entities)
  retrieved_scores = tf.reduce_sum(retrieved_index, axis=1)
  return tf.cast(tf.greater(retrieved_scores, 0.), tf.float32)
Check for which batch elements an answer is retrieved.
language/labs/drkit/model_fns.py