class_docstr: CoS-E: Common Sense Explanations corpus.
docstr: Yields examples.
code: def _generate_examples(self, files, **kwargs):
      """Yields examples."""
      cqa_indexed = kwargs["cqa_indexed"]
      for filepath in files:
          with epath.Path(filepath).open() as f:
              for line in f:
                  cos = json.loads(line)
                  cqa = cqa_indexed[cos["id"]]
                  choices, answer = _get_choices_and_answer(cqa)
                  yield cos["id"], {
                      "id": cos["id"],
                      "question": cqa["question"]["stem"],
                      "choices": choices,
                      "answer": answer,
                      "abstractive_explanation": cos["explanation"][
                          "open-ended"
                      ],
                      "extractive_explanation": cos["explanation"][
                          "selected"
                      ],
                  }
  
file_path: datasets/tensorflow_datasets/text/cos_e.py
imports: import json
  import os
  from etils import epath
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the CosE obj's underlying member method code with example usage: obj._generate_examples(files) without return types