class_docstr: The AI2 ARC dataset with Information Retrieval.
  
  Compared to the normal AI2 corpus, this adds a paragraph containing retrieved
  facts similar to the question + answers.
  
  Retrieved sentences are obtained following the UnifiedQA paper:
  https://arxiv.org/abs/2005.00700
class_docstr_tok: ["The","AI2","ARC","dataset","with","Information","Retrieval",".","Compared","to","the","normal","AI2","corpus",",","this","adds","a","paragraph","containing","retrieved","facts","similar","to","the","question","+","answers",".","Retrieved","sentences","are","obtained","following","the","UnifiedQA","paper",":","https",":","\/\/arxiv.org\/abs\/2005.00700"]
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(self, filepath: str, split: str):
      """Yields examples."""
      # Generally labels are in the format "A", "B", "C", "D" but sometimes
      # they are in the format "1", "2", "3", "4". We convert the later to the
      # former for consistency.
      n_to_l = dict(zip("1 2 3 4 5".split(), "A B C D E".split()))
      # IDs to keep:
      # Those that start with ARCEZ_ for the easy set
      # Those that start with ARCCH_ for the challenge set
      prefix = {"ARC-Easy-IR": "ARCEZ_", "ARC-Challenge-IR": "ARCCH_"}[
          split
      ]
      with epath.Path(filepath).open() as f:
          for row in f:
              data = json.loads(row)
              if not data["id"].startswith(prefix):
                  continue
              answerkey = n_to_l.get(
                  data["answerKey"], data["answerKey"]
              )
              id_ = data["id"].replace(prefix, "")
              question = data["question"]["stem"]
              choices = data["question"]["choices"]
              text_choices = [choice["text"] for choice in choices]
              label_choices = [
                  n_to_l.get(choice["label"], choice["label"])
                  for choice in choices
              ]
              paragraph = data["para"]
              yield id_, {
                  "id": id_,
                  "answerKey": answerkey,
                  "question": question,
                  "choices": {
                      "text": text_choices,
                      "label": label_choices,
                  },
                  "paragraph": paragraph,
              }
  
file_path: datasets/tensorflow_datasets/datasets/ai2_arc_with_ir/ai2_arc_with_ir_dataset_builder.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  import os
  from etils import epath
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the Builder obj's underlying member method code with example usage: obj._generate_examples(filepath, split) without return types