class_docstr: Subject verb agreement as language modeling task.
class_docstr_tok: ["Subject","verb","agreement","as","language","modeling","task","."]
docstr: Generates samples.
  
  Args:
    data_dir: data directory
    tmp_dir: temp directory
    dataset_split: dataset split
  
  Returns:
    sample generator.
docstr_tok: ["Generates","samples",".","Args",":","data_dir",":","data","directory","tmp_dir",":","temp","directory","dataset_split",":","dataset","split","Returns",":","sample","generator","."]
code: def generate_samples(self, data_dir, tmp_dir, dataset_split):
      """Generates samples.
  
      Args:
        data_dir: data directory
        tmp_dir: temp directory
        dataset_split: dataset split
  
      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
              targets = example[example_filed].split()[: index + 1]
              yield {"targets": " ".join(targets)}
  
      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 6 for calling the SvaLanguageModeling obj's underlying member method code with example usage: obj.generate_samples(data_dir, tmp_dir, dataset_split) and returns: _generate_samples