class_docstr: DatasetBuilder for wit dataset.
docstr: Yields examples.
code: def _generate_examples(self, filepaths):
      """Yields examples."""
      beam = tfds.core.lazy_imports.apache_beam
  
      def _process_example(elements):
          # Create a unique key for each example.
          filename, row_number, row = elements
          image_url = row["image_url"]
          example_key = f"{filename}_{row_number}_{image_url}"
          return example_key, {
              "language": row["language"],
              "page_url": row["page_url"],
              "image_url": row["image_url"],
              "page_title": row["page_title"],
              "section_title": row["section_title"],
              "hierarchical_section_title": row[
                  "hierarchical_section_title"
              ],
              "caption_reference_description": row[
                  "caption_reference_description"
              ],
              "caption_attribution_description": row[
                  "caption_attribution_description"
              ],
              "caption_alt_text_description": row[
                  "caption_alt_text_description"
              ],
              "mime_type": row["mime_type"],
              "original_height": int(row["original_height"]),
              "original_width": int(row["original_width"]),
              "is_main_image": bool(row["is_main_image"]),
              "attribution_passes_lang_id": bool(
                  row["attribution_passes_lang_id"]
              ),
              "page_changed_recently": bool(
                  row["page_changed_recently"]
              ),
              "context_page_description": row[
                  "context_page_description"
              ],
              "context_section_description": (
                  row["context_section_description"] or ""
              ),
          }
  
      def _read_rows(filename):
          # Limit to 100 MB. Value must be smaller than the C long maximum value.
          csv.field_size_limit(sys.maxsize)
          with epath.Path(filename).open() as f:
              csv_reader = csv.DictReader(
                  f, delimiter="\t", quoting=csv.QUOTE_MINIMAL
              )
              for i, row in enumerate(csv_reader):
                  yield filename, i, row
  
      return (
          beam.Create(filepaths)
          | beam.FlatMap(_read_rows)
          | beam.Map(_process_example)
      )
  
file_path: datasets/tensorflow_datasets/vision_language/wit/wit.py
imports: from __future__ import annotations
  import csv
  import os
  import sys
  from etils import epath
  import numpy
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the Wit obj's underlying member method code with example usage: obj._generate_examples(filepaths) and returns: unknown, example_key,  dict