class_docstr: Generate vocabulary and training data for parsing.
    
class_docstr_tok: ["Generate","vocabulary","and","training","data","for","parsing","."]
code: def generate_text_for_vocab(self, data_dir, tmp_dir):
      files = [os.path.join(tmp_dir, f) for f in self.TRAIN_FILES]
      inputs_file, targets_file = files
      for i, sample in enumerate(
          text_problems.text2text_txt_iterator(
              inputs_file, targets_file
          )
      ):
          yield sample["inputs"]
          yield sample["targets"]
          if (
              self.max_samples_for_vocab
              and (i + 1) >= self.max_samples_for_vocab
          ):
              break
  
file_path: tensor2tensor/tensor2tensor/data_generators/wsj_parsing.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl import flags
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling the WsjParsing obj's underlying member method code with example usage: obj.generate_text_for_vocab(data_dir, tmp_dir) without return types