class_docstr: This ``Field`` represents a list of string tokens.  Before constructing this object, you need
  to tokenize raw strings using a :class:`~allennlp.data.tokenizers.tokenizer.Tokenizer`.
  
  Because string tokens can be represented as indexed arrays in a number of ways, we also take a
  dictionary of :class:`~allennlp.data.token_indexers.token_indexer.TokenIndexer`
  objects that will be used to convert the tokens into indices.
  Each ``TokenIndexer`` could represent each token as a single ID, or a list of character IDs, or
  something else.
  
  This field will get converted into a dictionary of arrays, one for each ``TokenIndexer``.  A
  ``SingleIdTokenIndexer`` produces an array of shape (num_tokens,), while a
  ``TokenCharactersIndexer`` produces an array of shape (num_tokens, num_characters).
class_docstr_tok: ["This","``","Field","``","represents","a","list","of","string","tokens",".","Before","constructing","this","object",",","you","need","to","tokenize","raw","strings","using","a",":","class",":","`","~allennlp.data.tokenizers.tokenizer.Tokenizer","`",".","Because","string","tokens","can","be","represented","as","indexed","arrays","in","a","number","of","ways",",","we","also","take","a","dictionary","of",":","class",":","`","~allennlp.data.token_indexers.token_indexer.TokenIndexer","`","objects","that","will","be","used","to","convert","the","tokens","into","indices",".","Each","``","TokenIndexer","``","could","represent","each","token","as","a","single","ID",",","or","a","list","of","character","IDs",",","or","something","else",".","This","field","will","get","converted","into","a","dictionary","of","arrays",",","one","for","each","``","TokenIndexer","``",".","A","``","SingleIdTokenIndexer","``","produces","an","array","of","shape","(","num_tokens",",",")",",","while","a","``","TokenCharactersIndexer","``","produces","an","array","of","shape","(","num_tokens",",","num_characters",")","."]
code: def __init__(self, tokens, token_indexers):
      self.tokens = tokens
      self._token_indexers = token_indexers
      self._indexed_tokens = None
      self._indexer_name_to_indexed_token = None
  
      if not all([isinstance(x, (Token, SpacyToken)) for x in tokens]):
          raise ConfigurationError(
              "TextFields must be passed Tokens. "
              "Found: {} with types {}.".format(
                  tokens, [type(x) for x in tokens]
              )
          )
  
imports: from __future__ import absolute_import
  import textwrap
  from spacy.tokens import Token
  import torch
  from allennlp.common.checks import ConfigurationError
  from allennlp.data.fields.sequence_field import SequenceField
  from allennlp.data.tokenizers.token import Token
  from allennlp.data.token_indexers.token_indexer import TokenIndexer
  from allennlp.data.vocabulary import Vocabulary
  from allennlp.nn import util
label_desc: Use image node_id 1 to create a new TextField object from inherited base classes: SequenceField with example: obj = TextField(tokens, token_indexers)