class_docstr: This is a simple class of models that tags individual words in text.
docstr: Initializes a TokenClassifier.
  
  Args:
      embeddings: word embeddings used in tagger
      label_dictionary: dictionary of labels or BIO/BIOES tags you want to predict
      label_type: string identifier for tag type
      span_encoding: the format to encode spans as tags, either "BIO" or "BIOES"
      **classifierargs: The arguments propagated to :meth:`flair.nn.DefaultClassifier.__init__`
docstr_tok: ["Initializes","a","TokenClassifier",".","Args",":","embeddings",":","word","embeddings","used","in","tagger","label_dictionary",":","dictionary","of","labels","or","BIO\/BIOES","tags","you","want","to","predict","label_type",":","string","identifier","for","tag","type","span_encoding",":","the","format","to","encode","spans","as","tags",",","either","``","BIO","''","or","``","BIOES","''","*","*","classifierargs",":","The","arguments","propagated","to",":","meth",":","`","flair.nn.DefaultClassifier.__init__","`"]
code: def __init__(
      self,
      embeddings: TokenEmbeddings,
      label_dictionary: Dictionary,
      label_type: str,
      span_encoding: str = "BIOES",
      **classifierargs,
  ) -> None:
      """Initializes a TokenClassifier.
  
      Args:
          embeddings: word embeddings used in tagger
          label_dictionary: dictionary of labels or BIO/BIOES tags you want to predict
          label_type: string identifier for tag type
          span_encoding: the format to encode spans as tags, either "BIO" or "BIOES"
          **classifierargs: The arguments propagated to :meth:`flair.nn.DefaultClassifier.__init__`
      """
      # if the classifier predicts BIO/BIOES span labels, the internal label dictionary must be computed
      if label_dictionary.span_labels:
          internal_label_dictionary = (
              self._create_internal_label_dictionary(
                  label_dictionary, span_encoding
              )
          )
      else:
          internal_label_dictionary = label_dictionary
  
      super().__init__(
          embeddings=embeddings,
          label_dictionary=internal_label_dictionary,
          final_embedding_size=embeddings.embedding_length,
          **classifierargs,
      )
  
      # fields in case this is a span-prediction problem
      self.span_prediction_problem = (
          self._determine_if_span_prediction_problem(
              internal_label_dictionary
          )
      )
      self.span_encoding = span_encoding
  
      # the label type
      self._label_type: str = label_type
  
      # all parameters will be pushed internally to the specified device
      self.to(flair.device)
  
imports: import logging
  from pathlib import Path
  from typing import Any, Dict, List, Union
  import torch
  from deprecated.sphinx import deprecated
  import flair.nn
  from flair.data import Dictionary, Sentence, Span, Token
  from flair.embeddings import TokenEmbeddings
label_desc: Use image node_id 1 to create a new TokenClassifier object from inherited base classes: flair.nn.DefaultClassifier with example: obj = TokenClassifier(embeddings, label_dictionary, label_type, span_encoding)