class_docstr: Subject verb agreement as verb number predicion (binary classification).
class_docstr_tok: ["Subject","verb","agreement","as","verb","number","predicion","(","binary","classification",")","."]
docstr: Generate samples of text and label pairs.
  
  Each yielded dict will be a single example. The inputs should be raw text.
  The label should be an int in [0, self.num_classes).
  
  Args:
    data_dir: final data directory. Typically only used in this method to copy
      over user-supplied vocab files (for example, if vocab_type ==
      VocabType.TOKEN).
    tmp_dir: temporary directory that you can use for downloading and scratch.
    dataset_split: problem.DatasetSplit, which data split to generate samples
      for (for example, training and evaluation).
  
  Returns:
    sample generator.
docstr_tok: ["Generate","samples","of","text","and","label","pairs",".","Each","yielded","dict","will","be","a","single","example",".","The","inputs","should","be","raw","text",".","The","label","should","be","an","int","in","[","0",",","self.num_classes",")",".","Args",":","data_dir",":","final","data","directory",".","Typically","only","used","in","this","method","to","copy","over","user-supplied","vocab","files","(","for","example",",","if","vocab_type","==","VocabType.TOKEN",")",".","tmp_dir",":","temporary","directory","that","you","can","use","for","downloading","and","scratch",".","dataset_split",":","problem.DatasetSplit",",","which","data","split","to","generate","samples","for","(","for","example",",","training","and","evaluation",")",".","Returns",":","sample","generator","."]
code: def generate_samples(self, data_dir, tmp_dir, dataset_split):
      """Generate samples of text and label pairs.
  
      Each yielded dict will be a single example. The inputs should be raw text.
      The label should be an int in [0, self.num_classes).
  
      Args:
        data_dir: final data directory. Typically only used in this method to copy
          over user-supplied vocab files (for example, if vocab_type ==
          VocabType.TOKEN).
        tmp_dir: temporary directory that you can use for downloading and scratch.
        dataset_split: problem.DatasetSplit, which data split to generate samples
          for (for example, training and evaluation).
  
      Returns:
        sample generator.
      """
      example_filed = "sentence"
      examples_for_vocab, train, val, test = load_examples(
          tmp_dir, self.train_proportion, self.validation_proportion
      )
      _build_vocab(
          examples_for_vocab,
          example_filed,
          data_dir,
          self.vocab_filename,
      )
      if dataset_split == problem.DatasetSplit.TRAIN:
          examples = train
  
      elif dataset_split == problem.DatasetSplit.EVAL:
          examples = val
  
      elif dataset_split == problem.DatasetSplit.TEST:
          examples = test
  
      def _generate_samples():
          for example in examples:
              index = int(example["verb_index"]) - 1
              inputs = example[example_filed].split()[:index]
              yield {
                  "inputs": " ".join(inputs),
                  "label": _LABEL_DICT[example["verb_pos"]],
              }
  
      return _generate_samples()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import csv
  import gzip
  import os
  import random
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.utils import metrics
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 8 for calling the SvaNumberPrediction obj's underlying member method code with example usage: obj.generate_samples(data_dir, tmp_dir, dataset_split) and returns: _generate_samples