class_docstr: A module to perform token level classification tasks such as Named entity recognition.
class_docstr_tok: ["A","module","to","perform","token","level","classification","tasks","such","as","Named","entity","recognition","."]
docstr: Initializes the Token Classifier module.
  
  Args:
      hidden_size: the size of the hidden dimension
      num_classes: number of classes
      num_layers: number of fully connected layers in the multilayer perceptron (MLP)
      activation: activation to usee between fully connected layers in the MLP
      log_softmax: whether to apply softmax to the output of the MLP
      dropout: dropout to apply to the input hidden states
      use_transformer_init: whether to initialize the weights of the classifier head with the same approach used in Transformer
docstr_tok: ["Initializes","the","Token","Classifier","module",".","Args",":","hidden_size",":","the","size","of","the","hidden","dimension","num_classes",":","number","of","classes","num_layers",":","number","of","fully","connected","layers","in","the","multilayer","perceptron","(","MLP",")","activation",":","activation","to","usee","between","fully","connected","layers","in","the","MLP","log_softmax",":","whether","to","apply","softmax","to","the","output","of","the","MLP","dropout",":","dropout","to","apply","to","the","input","hidden","states","use_transformer_init",":","whether","to","initialize","the","weights","of","the","classifier","head","with","the","same","approach","used","in","Transformer"]
code: def __init__(
      self,
      hidden_size: int,
      num_classes: int,
      num_layers: int = 1,
      activation: str = "relu",
      log_softmax: bool = True,
      dropout: float = 0.0,
      use_transformer_init: bool = True,
  ) -> None:
      """
      Initializes the Token Classifier module.
  
      Args:
          hidden_size: the size of the hidden dimension
          num_classes: number of classes
          num_layers: number of fully connected layers in the multilayer perceptron (MLP)
          activation: activation to usee between fully connected layers in the MLP
          log_softmax: whether to apply softmax to the output of the MLP
          dropout: dropout to apply to the input hidden states
          use_transformer_init: whether to initialize the weights of the classifier head with the same approach used in Transformer
      """
      super().__init__(hidden_size=hidden_size, dropout=dropout)
      self.log_softmax = log_softmax
      self.mlp = MultiLayerPerceptron(
          hidden_size,
          num_classes,
          num_layers=num_layers,
          activation=activation,
          log_softmax=log_softmax,
      )
      self.post_init(use_transformer_init=use_transformer_init)
  
file_path: NeMo/nemo/collections/nlp/modules/common/token_classifier.py
imports: from dataclasses import dataclass
  from typing import Dict, Optional
  from torch import nn
  from nemo.collections.common.parts import MultiLayerPerceptron
  from nemo.collections.nlp.modules.common.classifier import Classifier
  from nemo.core.classes import typecheck
  from nemo.core.neural_types import LogitsType, LogprobsType, NeuralType
label_desc: Use image node_id 2 to create a new TokenClassifier object from inherited base classes: Classifier with example: obj = TokenClassifier(hidden_size, num_classes, num_layers, activation, log_softmax, dropout, use_transformer_init)