docstr: :param checkpoint: Checkpoint for pre-trained model. This is expected to
                      be a checkpoint you could find on [HuggingFace](https://huggingface.co/models)
                      and is of type `AutoModelForSequenceClassification`.
  :param text_col: Text column name.
  :param label_col: Label column name.
  :param num_labels: Number of labels for classification.
  :param additional_layers_to_train: Additional number of layers to train on. For Deep text model
                                      we'd better choose a positive number for better performance.
  :param optimizer_name: Name of the optimizer.
  :param loss_name: Name of the loss function.
  :param learning_rate: Learning rate for the optimizer.
  :param train_from_scratch: Whether train the model from scratch or not. If this is set to true then
                              additional_layers_to_train param will be ignored. Default to True.
docstr_tok: [":","param","checkpoint",":","Checkpoint","for","pre-trained","model",".","This","is","expected","to","be","a","checkpoint","you","could","find","on","[","HuggingFace","]","(","https",":","\/\/huggingface.co\/models",")","and","is","of","type","`","AutoModelForSequenceClassification","`",".",":","param","text_col",":","Text","column","name",".",":","param","label_col",":","Label","column","name",".",":","param","num_labels",":","Number","of","labels","for","classification",".",":","param","additional_layers_to_train",":","Additional","number","of","layers","to","train","on",".","For","Deep","text","model","we","'d","better","choose","a","positive","number","for","better","performance",".",":","param","optimizer_name",":","Name","of","the","optimizer",".",":","param","loss_name",":","Name","of","the","loss","function",".",":","param","learning_rate",":","Learning","rate","for","the","optimizer",".",":","param","train_from_scratch",":","Whether","train","the","model","from","scratch","or","not",".","If","this","is","set","to","true","then","additional_layers_to_train","param","will","be","ignored",".","Default","to","True","."]
code: def __init__(
      self,
      checkpoint,
      text_col,
      label_col,
      num_labels,
      additional_layers_to_train,
      optimizer_name,
      loss_name,
      learning_rate=None,
      train_from_scratch=True,
  ):
      """
      :param checkpoint: Checkpoint for pre-trained model. This is expected to
                          be a checkpoint you could find on [HuggingFace](https://huggingface.co/models)
                          and is of type `AutoModelForSequenceClassification`.
      :param text_col: Text column name.
      :param label_col: Label column name.
      :param num_labels: Number of labels for classification.
      :param additional_layers_to_train: Additional number of layers to train on. For Deep text model
                                          we'd better choose a positive number for better performance.
      :param optimizer_name: Name of the optimizer.
      :param loss_name: Name of the loss function.
      :param learning_rate: Learning rate for the optimizer.
      :param train_from_scratch: Whether train the model from scratch or not. If this is set to true then
                                  additional_layers_to_train param will be ignored. Default to True.
      """
      super(LitDeepTextModel, self).__init__()
  
      self.checkpoint = checkpoint
      self.text_col = text_col
      self.label_col = label_col
      self.num_labels = num_labels
      self.additional_layers_to_train = additional_layers_to_train
      self.optimizer_name = optimizer_name
      self.loss_name = loss_name
      self.learning_rate = learning_rate
      self.train_from_scratch = train_from_scratch
  
      self._check_params()
  
      self.save_hyperparameters(
          "checkpoint",
          "text_col",
          "label_col",
          "num_labels",
          "additional_layers_to_train",
          "optimizer_name",
          "loss_name",
          "learning_rate",
          "train_from_scratch",
      )
  
file_path: SynapseML/deep-learning/src/main/python/synapse/ml/dl/LitDeepTextModel.py
imports: import inspect
  import pytorch_lightning
  import torch
  import torch.nn.functional
  import torch.optim
  from pytorch_lightning.utilities import _module_available
label_desc: Use image node_id 1 to create a new LitDeepTextModel object from inherited base classes: pl with example: obj = LitDeepTextModel(checkpoint, text_col, label_col, num_labels, additional_layers_to_train, optimizer_name, loss_name, learning_rate, train_from_scratch)