def _get_gold_examples(
      self,
      *,
      claim_json,
      scrape_type,
  ):
    """Create gold examples and seed the example dictionary with them.

    Args:
      claim_json: The json of the claim from fever dataset
      scrape_type: What type to label gold as, technically this isn't that
        scrape type, but it makes grouping by scrape type easier to do later on.

    Returns:
      A dictionary of examples keyed by (wikipedia_url, sentence_id)
    """
    examples = {}
    used_wikipedia_urls = set()
    claim_label = claim_json['label']
    # For NOT ENOUGH INFO, there are no gold examples
    if claim_label == constants.NOT_ENOUGH_INFO:
      return examples, used_wikipedia_urls
    for evidence_set in claim_json['evidence']:
      for evidence in evidence_set:
        wikipedia_url = util.normalize(evidence[2])
        used_wikipedia_urls.add(wikipedia_url)
        sentence_id = evidence[3]
        page = self._wiki_db.get_page(wikipedia_url)
        if page is None:
          raise ValueError(f'Missing page: {wikipedia_url}')
        if sentence_id in page.sentences:
          sentence = page.sentences[sentence_id].text
          key = (wikipedia_url, sentence_id)
          # FEVER sometimes has duplicated evidence if it was picked by
          # multiple raters.
          if key not in examples:
            sentence_with_title = underscore_to_whitespace(
                wikipedia_url) + ' ' + sentence
            examples[key] = {
                'evidence_text': sentence,
                'evidence_text_with_title': sentence_with_title,
                'evidence_label': constants.MATCHING,
                'claim_label': claim_label,
                'gold': True,
                'retrieved': False,
                'background': False,
                'doc_score': -1,
                'wikipedia_url': wikipedia_url,
                'sentence_id': sentence_id,
                'scrape_type': scrape_type,
            }
    return examples, used_wikipedia_urls
Create gold examples and seed the example dictionary with them.

    Args:
      claim_json: The json of the claim from fever dataset
      scrape_type: What type to label gold as, technically this isn't that
        scrape type, but it makes grouping by scrape type easier to do later on.

    Returns:
      A dictionary of examples keyed by (wikipedia_url, sentence_id)
    
language/serene/fever_tfds.py