class_docstr: Generate vocabulary and training data for parsing.
    
class_docstr_tok: ["Generate","vocabulary","and","training","data","for","parsing","."]
code: def generate_encoded_samples(self, data_dir, tmp_dir, dataset_split):
      generator = self.generate_samples(
          data_dir, tmp_dir, dataset_split
      )
      encoder = self.get_or_create_vocab(data_dir, tmp_dir)
      return text_problems.text2text_generate_encoded(
          generator, encoder, has_inputs=self.has_inputs
      )
  
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 2 for calling the WsjParsing obj's underlying member method code with example usage: obj.generate_encoded_samples(data_dir, tmp_dir, dataset_split) and returns: text_problems