def _create_test_examples(self, *, claim_json, scrape_type,
                            n_inference_candidates):
    """Create test examples for fever task.

    This function is similar to create_validation_examples, but handles the
    fact that: (1) there are no gold examples and (2) examples only have fields
    "id" and "claim"

    This function follows these steps/guidelines:
    1. Get up to the top n_inference_documents rated documents
    2. Return up to the first thirty sentences in each document
    3. In total, return n_inference_candidates, obtaining the max by iteratively
      getting the 1st sentence of each doc, then second etc.

    Args:
      claim_json: The fever claim to get examples for
      scrape_type: The scrape type to use
      n_inference_candidates: Number of candidates to return

    Returns:
      Examples for test on fever
    """
    claim_id = claim_json['id']

    # Add retrieved documents as negatives
    # For inference, we generate the input documents for each type of way
    # to get them, the scoring script handles separating this out to create
    # metrics for each method so we can compare
    documents = self._get_retrieved_documents(
        claim_id,
        scrape_type=scrape_type,
    )
    documents = documents[:self._n_inference_documents]
    candidates: List[types.Json] = []
    for wikipedia_url, ir_score in documents:
      parsed_page = self._wiki_db.get_page(wikipedia_url)
      if parsed_page is None:
        self._n_missing_pages.inc()
        continue
      for sentence_id in range(self._max_inference_sentence_id):
        if sentence_id in parsed_page.sentences:
          sentence_struct = parsed_page.sentences[sentence_id]
          sentence_with_title = underscore_to_whitespace(
              wikipedia_url) + ' ' + sentence_struct.text
          example = {
              'evidence_text': sentence_struct.text,
              'evidence_text_with_title': sentence_with_title,
              'evidence_label': constants.NOT_MATCHING,
              # This label does not mean anything since test examples are not
              # labeled, but it must exist and be valid for TFDS to work
              # correctly.
              'claim_label': constants.REFUTES,
              'gold': False,
              'retrieved': True,
              'background': False,
              'tfidf_candidate': True,
              'wikipedia_url': wikipedia_url,
              'sentence_id': sentence_id,
              'doc_score': ir_score,
              'scrape_type': scrape_type,
              # This sorts examples with smallest sentence_id to the top
              'sentence_score': -sentence_id
          }
          candidates.append(example)

    return sorted(
        candidates, reverse=True,
        key=lambda c: c['sentence_score'])[:n_inference_candidates]
Create test examples for fever task.

    This function is similar to create_validation_examples, but handles the
    fact that: (1) there are no gold examples and (2) examples only have fields
    "id" and "claim"

    This function follows these steps/guidelines:
    1. Get up to the top n_inference_documents rated documents
    2. Return up to the first thirty sentences in each document
    3. In total, return n_inference_candidates, obtaining the max by iteratively
      getting the 1st sentence of each doc, then second etc.

    Args:
      claim_json: The fever claim to get examples for
      scrape_type: The scrape type to use
      n_inference_candidates: Number of candidates to return

    Returns:
      Examples for test on fever
    
language/serene/fever_tfds.py