class_docstr: Generate vocabulary and training data for parsing.
    
class_docstr_tok: ["Generate","vocabulary","and","training","data","for","parsing","."]
code: def generate_samples(self, data_dir, tmp_dir, dataset_split):
      del data_dir
      is_training = dataset_split == problem.DatasetSplit.TRAIN
      tree_file = (
          self.TRAIN_FILES_TREE if is_training else self.EVAL_FILES_TREE
      )
      tree_file_path = os.path.join(tmp_dir, tree_file)
      with tf.gfile.GFile(tree_file_path, mode="r") as cur_tree_file:
          for line in cur_tree_file:
              (words, tags) = words_and_tags_from_wsj_tree(line)
              yield {"inputs": words, "targets": tags}
  
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 1 for calling the WsjParsing obj's underlying member method code with example usage: obj.generate_samples(data_dir, tmp_dir, dataset_split) without return types