from tensorflow.contrib.learn.python.learn.preprocessing.text import CategoricalVocabulary

    if vocabulary:
      self.vocabulary_ = vocabulary
    else:
      self.vocabulary_ = CategoricalVocabulary(support_reverse=True)
    if tokenizer_fn:
      self._tokenizer = tokenizer_fn
