class_docstr: DatasetBuilder for quality dataset.
class_docstr_tok: ["DatasetBuilder","for","quality","dataset","."]
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(self, path, split: str):
      """Yields examples."""
      for line in path.open():
          j = json.loads(line)
          fields = {k: j[k] for k in _ONE2ONE_FIELDS}
          fields.update(
              {
                  "questions": [q["question"] for q in j["questions"]],
                  "question_ids": [
                      q["question_unique_id"] for q in j["questions"]
                  ],
                  "difficults": [
                      q["difficult"] for q in j["questions"]
                  ],
                  "options": [q["options"] for q in j["questions"]],
              }
          )
          if split in ("train", "dev"):
              fields.update(
                  {
                      "gold_labels": [
                          q["gold_label"] for q in j["questions"]
                      ],
                      "writer_labels": [
                          q["writer_label"] for q in j["questions"]
                      ],
                  }
              )
          else:
              fields.update(
                  {
                      "gold_labels": [],
                      "writer_labels": [],
                  }
              )
          yield j["set_unique_id"], fields
  
file_path: datasets/tensorflow_datasets/datasets/quality/quality_dataset_builder.py
imports: import dataclasses
  import json
  import numpy
  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(path, split) without return types