class_docstr: CFQ task / splits.
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(self, base_directory, splits_file, split_id):
      """Yields examples."""
      samples_path = os.path.join(base_directory, "dataset.json")
      splits_path = os.path.join(base_directory, splits_file)
      with epath.Path(samples_path).open() as samples_file:
          with epath.Path(splits_path).open() as splits_file:
              logging.info(
                  "Reading json from %s into memory...", samples_path
              )
              samples = json.loads(
                  self._scrub_json(samples_file.read())
              )
              logging.info("%d samples loaded", len(samples))
              logging.info("Loaded json data from %s.", samples_path)
              splits = json.load(splits_file)
              for idx in splits[split_id]:
                  sample = samples[idx]
                  yield idx, {
                      _QUESTION: sample[_QUESTION_FIELD],
                      _QUERY: sample[_QUERY_FIELD],
                  }
  
file_path: datasets/tensorflow_datasets/text/cfq.py
imports: import json
  import os
  import re
  from absl import logging
  from etils import epath
  import tensorflow_datasets.public_api
label_desc: Use image node_id 4 for calling the CFQ obj's underlying member method code with example usage: obj._generate_examples(base_directory, splits_file, split_id) without return types