class_docstr: Base class for WMT20 Datasets.
class_docstr_tok: ["Base","class","for","WMT20","Datasets","."]
code: def generate_text_for_vocab(self, data_dir, tmp_dir):
      for i, sample in enumerate(
          self.generate_samples(
              data_dir, tmp_dir, problem.DatasetSplit.TRAIN
          )
      ):
          if self.has_inputs:
              yield sample["inputs"]
          yield sample["targets"]
          if (
              self.max_samples_for_vocab
              and (i + 1) >= self.max_samples_for_vocab
          ):
              break
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import gzip
  import os
  import tarfile
  import zipfile
  from tensor2tensor.data_generators import cleaner_en_xx
  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 bleu_hook
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import mlperf_log
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling the TranslateWmt20Problem obj's underlying member method code with example usage: obj.generate_text_for_vocab(data_dir, tmp_dir) without return types