def compute_claim_recall(
    claim_json,
    ranked_claim_evidence):
  """Compute the recall position for a single claim.

  Args:
    claim_json: The json of the fever claim
    ranked_claim_evidence: A ranked list of evidence

  Returns:
    The recall position
  """
  gold_evidence: Set[Tuple[Text, int]] = set()
  for evidence_set in claim_json['evidence']:
    for evidence in evidence_set:
      if evidence is not None:
        if evidence[2] is not None and evidence[3] is not None:
          gold_evidence.add((evidence[2], evidence[3]))

  retrieved_evidence = []
  for example in ranked_claim_evidence:
    if example.metadata['tfidf_candidate']:
      retrieved_evidence.append(example.metadata)

  if not retrieved_evidence:
    return None
  recall_position = None
  for idx, doc in enumerate(retrieved_evidence, start=1):
    wikipedia_url = doc['wikipedia_url']
    sentence_id = doc['sentence_id']
    if (wikipedia_url, sentence_id) in gold_evidence:
      recall_position = idx
      break

  if recall_position is None:
    return sys.maxsize
  else:
    return recall_position
Compute the recall position for a single claim.

  Args:
    claim_json: The json of the fever claim
    ranked_claim_evidence: A ranked list of evidence

  Returns:
    The recall position
  
language/serene/callbacks.py