class_docstr: Base class for bAbi question answering problems.
class_docstr_tok: ["Base","class","for","bAbi","question","answering","problems","."]
docstr: Builds encoder for the given class labels.
  
  Args:
    data_dir: data directory
  
  Returns:
    An encoder for class labels.
docstr_tok: ["Builds","encoder","for","the","given","class","labels",".","Args",":","data_dir",":","data","directory","Returns",":","An","encoder","for","class","labels","."]
code: def get_labels_encoder(self, data_dir):
      """Builds encoder for the given class labels.
  
      Args:
        data_dir: data directory
  
      Returns:
        An encoder for class labels.
      """
      label_filepath = os.path.join(data_dir, self.vocab_filename)
      return text_encoder.TokenTextEncoder(label_filepath)
  
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 10 for calling the BabiQa obj's underlying member method code with example usage: obj.get_labels_encoder(data_dir) and returns: text_encoder