class_docstr: DatasetBuilder for mrqa dataset.
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(self, path, split):
      """Yields examples."""
      with epath.Path(path).open() as f:
          header = next(f)
          subset = json.loads(header)["header"]["dataset"]
  
          for row in f:
              paragraph = json.loads(row)
              context = paragraph["context"].strip()
              context_tokens = [
                  {"tokens": t[0], "offsets": t[1]}
                  for t in paragraph["context_tokens"]
              ]
              for qa in paragraph["qas"]:
                  qid = qa["qid"]
                  question = qa["question"].strip()
                  question_tokens = [
                      {"tokens": t[0], "offsets": t[1]}
                      for t in qa["question_tokens"]
                  ]
                  detected_answers = []
                  for detect_ans in qa["detected_answers"]:
                      detected_answers.append(
                          {
                              "text": detect_ans["text"].strip(),
                              "char_spans": [
                                  {"start": t[0], "end": t[1]}
                                  for t in detect_ans["char_spans"]
                              ],
                              "token_spans": [
                                  {"start": t[0], "end": t[1]}
                                  for t in detect_ans["token_spans"]
                              ],
                          }
                      )
                  answers = qa["answers"]
                  yield f"{split}+{subset}_{qid}", {
                      "subset": subset,
                      "context": context,
                      "context_tokens": context_tokens,
                      "qid": qid,
                      "question": question,
                      "question_tokens": question_tokens,
                      "detected_answers": detected_answers,
                      "answers": answers,
                  }
  
file_path: datasets/tensorflow_datasets/text/mrqa/mrqa.py
imports: from __future__ import annotations
  import json
  import textwrap
  from etils import epath
  import numpy
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the MRQA obj's underlying member method code with example usage: obj._generate_examples(path, split) without return types