class_docstr: DatasetBuilder for controlled_noisy_web_labels dataset.
class_docstr_tok: ["DatasetBuilder","for","controlled_noisy_web_labels","dataset","."]
docstr: Yields examples for the validation set.
docstr_tok: ["Yields","examples","for","the","validation","set","."]
code: def _generate_val_examples(self, split_file, archive):
      """Yields examples for the validation set."""
      with epath.Path(split_file).open() as fp:
          split_info = fp.read().splitlines()
  
      split_names, split_labels = map(
          list, zip(*[elem.split(" ") for elem in split_info])
      )
  
      for fname, fobj in archive:
          # Remove the .JPEG
          fname = fname[:-5]
          if fname + ".jpg" in split_names:
              label_idx = split_names.index(fname + ".jpg")
              example = {}
              example["is_clean"] = 1
              buf = fobj.read()
              example["image"] = self._resize_image(buf)
              example["label"] = int(split_labels[label_idx])
              example["id"] = fname
  
              yield fname, example
  
file_path: datasets/tensorflow_datasets/image_classification/controlled_noisy_web_labels/controlled_noisy_web_labels.py
imports: import csv
  import dataclasses
  import io
  import json
  import os
  from etils import epath
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 6 for calling the ControlledNoisyWebLabels obj's underlying member method code with example usage: obj._generate_val_examples(split_file, archive) without return types