class_docstr: Classification and tagging of 2M comments on news sites.
  
  This version of the CivilComments Dataset provides access to the primary
  seven labels that were annotated by crowd workers, the toxicity and other
  tags are a value between 0 and 1 indicating the fraction of annotators that
  assigned these attributes to the comment text.
  
  The other tags are only available for a fraction of the input examples. They
  are currently ignored for the main dataset; the CivilCommentsIdentities set
  includes those labels, but only consists of the subset of the data with them.
  The other attributes that were part of the original CivilComments release are
  included only in the raw data. See the Kaggle documentation for more details
  about the available features.
class_docstr_tok: ["Classification","and","tagging","of","2M","comments","on","news","sites",".","This","version","of","the","CivilComments","Dataset","provides","access","to","the","primary","seven","labels","that","were","annotated","by","crowd","workers",",","the","toxicity","and","other","tags","are","a","value","between","0","and","1","indicating","the","fraction","of","annotators","that","assigned","these","attributes","to","the","comment","text",".","The","other","tags","are","only","available","for","a","fraction","of","the","input","examples",".","They","are","currently","ignored","for","the","main","dataset",";","the","CivilCommentsIdentities","set","includes","those","labels",",","but","only","consists","of","the","subset","of","the","data","with","them",".","The","other","attributes","that","were","part","of","the","original","CivilComments","release","are","included","only","in","the","raw","data",".","See","the","Kaggle","documentation","for","more","details","about","the","available","features","."]
docstr: Yields examples.
  
  Each example contains a text input followed by several toxicity subtype
  scores, identity labels if include_identity_labels is True, and covert
  offensiveness labels if include_covert_labels is True.
  
  Args:
    filename: the path of the file to be read for this split.
    mode: the specifc data subset and features to yield.
    split: the split to extract, one of train, public_test, private_test.
  
  Yields:
    A dictionary of features, depending upon the mode.
docstr_tok: ["Yields","examples",".","Each","example","contains","a","text","input","followed","by","several","toxicity","subtype","scores",",","identity","labels","if","include_identity_labels","is","True",",","and","covert","offensiveness","labels","if","include_covert_labels","is","True",".","Args",":","filename",":","the","path","of","the","file","to","be","read","for","this","split",".","mode",":","the","specifc","data","subset","and","features","to","yield",".","split",":","the","split","to","extract",",","one","of","train",",","public_test",",","private_test",".","Yields",":","A","dictionary","of","features",",","depending","upon","the","mode","."]
code: def _generate_examples(self, filename, mode, split):
      """Yields examples.
  
      Each example contains a text input followed by several toxicity subtype
      scores, identity labels if include_identity_labels is True, and covert
      offensiveness labels if include_covert_labels is True.
  
      Args:
        filename: the path of the file to be read for this split.
        mode: the specifc data subset and features to yield.
        split: the split to extract, one of train, public_test, private_test.
  
      Yields:
        A dictionary of features, depending upon the mode.
      """
      with epath.Path(filename).open() as f:
          reader = csv.DictReader(f)
          for row in reader:
              if mode == "spans":
                  if row["spans_split"] == split:
                      example = _parse_spans_row_as_example(row)
                      yield row["id"], example
              else:
                  if row["split"] == split:
                      example = _parse_row_as_example(row, mode)
                      if example:
                          yield row["id"], example
  
file_path: datasets/tensorflow_datasets/text/civil_comments.py
imports: from __future__ import annotations
  import ast
  import csv
  import os
  from etils import epath
  import numpy
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the CivilComments obj's underlying member method code with example usage: obj._generate_examples(filename, mode, split) without return types