class_docstr: This is a dataset for paraphrase identification.
class_docstr_tok: ["This","is","a","dataset","for","paraphrase","identification","."]
docstr: Yeilds Examples.
  
  Args:
    labels_path: The file path for ids, tokenized texts and labels.
    mappings_path: The file path for ids and mapping tags.
    tags2texts: The dictionary of mapping tags to raw texts.
  
  Yields:
    Generator yielding the next examples
docstr_tok: ["Yeilds","Examples",".","Args",":","labels_path",":","The","file","path","for","ids",",","tokenized","texts","and","labels",".","mappings_path",":","The","file","path","for","ids","and","mapping","tags",".","tags2texts",":","The","dictionary","of","mapping","tags","to","raw","texts",".","Yields",":","Generator","yielding","the","next","examples"]
code: def _generate_examples(
      self,
      labels_path: str,
      mappings_path: str,
      tags2texts: Dict[str, str],
  ):
      """Yeilds Examples.
  
      Args:
        labels_path: The file path for ids, tokenized texts and labels.
        mappings_path: The file path for ids and mapping tags.
        tags2texts: The dictionary of mapping tags to raw texts.
  
      Yields:
        Generator yielding the next examples
      """
      if tags2texts:
          # uses mapping tags to create dataset with raw texts.
          with epath.Path(labels_path).open() as f:
              # tsv file format: id  sentence1  sentence2  label
              labels = list(csv.DictReader(f, delimiter="\t"))
          with epath.Path(mappings_path).open() as f:
              # tsv file format: id  mapping1  mapping2
              tags = list(csv.DictReader(f, delimiter="\t"))
          if len(labels) != len(tags):
              raise ValueError(
                  "Expect same number of labels and mapping tags. "
                  f"Got {len(labels)} vs {len(tags)} instead."
              )
          for label_ex, tag_ex in zip(labels, tags):
              if label_ex["id"] != tag_ex["id"]:
                  raise ValueError(
                      "Expect matched id as key from labels file and mappings file. "
                      f"Got {label_ex['id']} vs {tag_ex['id']} instead."
                  )
              key = label_ex["id"]
              example = {
                  "sentence1": tags2texts[tag_ex["mapping1"]],
                  "sentence2": tags2texts[tag_ex["mapping2"]],
                  "label": int(label_ex["label"]),
              }
              yield key, example
      else:
          # creates dataset with tokenized texts.
          with epath.Path(labels_path).open() as f:
              reader = csv.DictReader(f, delimiter="\t")
              # tsv file format: id  sentence1  sentence2 label
              for row in reader:
                  key = row["id"]
                  label_str = (
                      "noisy_label"
                      if self.builder_config.subset == _UNLABELED_FINAL
                      else "label"
                  )
                  example = {
                      "sentence1": row["sentence1"],
                      "sentence2": row["sentence2"],
                      "label": int(row[label_str]),
                  }
                  yield key, example
  
file_path: datasets/tensorflow_datasets/datasets/paws_wiki/paws_wiki_dataset_builder.py
imports: import csv
  import os
  from typing import Dict
  from etils import epath
  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(labels_path, mappings_path, tags2texts) without return types