class_docstr: Base class for bAbi question answering problems.
class_docstr_tok: ["Base","class","for","bAbi","question","answering","problems","."]
docstr: A generator that generates samples that are encoded.
  
  Args:
    data_dir: data directory
    tmp_dir: temp directory
    dataset_split: dataset split
  
  Yields:
    A dict.
docstr_tok: ["A","generator","that","generates","samples","that","are","encoded",".","Args",":","data_dir",":","data","directory","tmp_dir",":","temp","directory","dataset_split",":","dataset","split","Yields",":","A","dict","."]
code: def generate_encoded_samples(self, data_dir, tmp_dir, dataset_split):
      """A generator that generates samples that are encoded.
  
      Args:
        data_dir: data directory
        tmp_dir: temp directory
        dataset_split: dataset split
  
      Yields:
        A dict.
  
      """
      generator = self.generate_samples(
          data_dir, tmp_dir, dataset_split
      )
      encoder = self.get_or_create_vocab(data_dir, tmp_dir)
      label_encoder = self.get_labels_encoder(data_dir)
      for sample in generator:
          inputs = encoder.encode(sample["inputs"])
          inputs.append(text_encoder.EOS_ID)
          context = encoder.encode(sample["context"])
          context.append(text_encoder.EOS_ID)
          targets = label_encoder.encode(sample["targets"])
          sample["targets"] = targets
          yield {
              "inputs": inputs,
              "context": context,
              "targets": targets,
          }
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import os
  import shutil
  import tarfile
  import requests
  import six
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.data_generators import tokenizer
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import metrics
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 12 for calling the BabiQa obj's underlying member method code with example usage: obj.generate_encoded_samples(data_dir, tmp_dir, dataset_split) without return types