def run_tf_evaluation(self, logits, labels,
                        prefix = ''):
    """Compute evaluation metrics.

    Args:
      logits: batch_size, num_candidate
      labels: batch_size, num_candidate
      prefix: prefix for evaluation key name

    Returns:
      evaluation metrics
    """
    hits_at_one = util.compute_hits_at_k(logits, labels, k=1)
    hits_at_five = util.compute_hits_at_k(logits, labels, k=5)

    recall_at_one = util.compute_recall_at_k(logits, labels, k=1)
    recall_at_five = util.compute_recall_at_k(logits, labels, k=5)

    average_precision_at_5 = \
        util.compute_average_precision_at_k(logits, labels, k=5)

    evaluations = {
        prefix + 'hits@1': tf.metrics.mean(hits_at_one),
        prefix + 'hits@5': tf.metrics.mean(hits_at_five),
        prefix + 'recall@1': tf.metrics.mean(recall_at_one),
        prefix + 'recall@5': tf.metrics.mean(recall_at_five),
        prefix + 'map@5': tf.metrics.mean(average_precision_at_5),
    }

    return evaluations
Compute evaluation metrics.

    Args:
      logits: batch_size, num_candidate
      labels: batch_size, num_candidate
      prefix: prefix for evaluation key name

    Returns:
      evaluation metrics
    
language/emql/model.py