class_docstr: Configuration for `tfds.features.Text`.
class_docstr_tok: ["Configuration","for","`","tfds.features.Text","`","."]
code: def __init__(
      self, encoder=None, encoder_cls=None, vocab_size=None, name=None
  ):
      if encoder:
          if encoder_cls or vocab_size:
              raise ValueError(
                  "If encoder is provided, encoder_cls and vocab_size must be None"
              )
          encoder_cls = type(encoder)
          vocab_size = encoder.vocab_size
      else:
          if encoder_cls is ByteTextEncoder:
              encoder = encoder_cls()
  
      self.encoder = encoder
      self.encoder_cls = encoder_cls
      self.vocab_size = vocab_size
      self.name = name
  
imports: from __future__ import unicode_literals
  import abc
  import hashlib
  import json
  import re
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 1 to create a new TextEncoderConfig object  with example: obj = TextEncoderConfig(encoder, encoder_cls, vocab_size, name)