def score_claim_to_wiki(self, n = 5):
    """Score all claims to wikipedia and return the predictions.

    Args:
      n: Number of predictions to make per claim

    Returns:
      Top ranked wikipedia sentences per claim
    """
    logging.info('TF Initializing')
    if self._claim_embeddings is None:
      raise ValueError('Claim embeddings are not loaded')
    with tf.device(self._device):
      idx = 0
      top_idx = []
      top_scores = []
      bar = tqdm.tqdm(total=self._claim_embeddings.shape[0])
      # batch_size: over n_claims
      while idx < self._claim_embeddings.shape[0]:
        # (batch_size, emb_dim)
        batch = self._claim_embeddings[idx:idx + self._batch_size, :]
        # (n_wiki_embeddings, batch_size)
        batch_scores = tf.linalg.matmul(
            # wiki_embeddings: (n_wiki_embeddings, emb_dim)
            self._wiki_embeddings,
            batch,
            transpose_b=True)
        # <float>(batch_size, n_wiki_embeddings)
        batch_scores = tf.transpose(batch_scores)
        # <float>(batch_size, n), <long>(batch_size, n)
        batch_top_scores, batch_top_idx = tf.nn.top_k(batch_scores, k=n)
        top_idx.append(batch_top_idx.numpy())
        top_scores.append(batch_top_scores.numpy())
        idx += self._batch_size
        bar.update(self._batch_size)
      bar.close()
      top_idx = np.vstack(top_idx)
      top_scores = np.vstack(top_scores)

    claim_id_to_scored_keys = {}
    for claim_index in range(top_idx.shape[0]):
      row = top_idx[claim_index]
      wiki_keys = []
      for idx in row:
        wiki_keys.append(self._idx_to_key[idx])
      claim_id = self._claim_ids[claim_index]
      claim_id_to_scored_keys[claim_id] = {
          'wiki_keys': wiki_keys,
          'scores': top_scores[claim_index]
      }

    return claim_id_to_scored_keys
Score all claims to wikipedia and return the predictions.

    Args:
      n: Number of predictions to make per claim

    Returns:
      Top ranked wikipedia sentences per claim
    
language/serene/wiki_index.py