class_docstr: Transformer word tagging classifier
  Args:
      model_type(str): model family (classifier head), choose between bert/quant_bert/xlnet
      labels (List[str], optional): list of tag labels
class_docstr_tok: ["Transformer","word","tagging","classifier","Args",":","model_type","(","str",")",":","model","family","(","classifier","head",")",",","choose","between","bert\/quant_bert\/xlnet","labels","(","List","[","str","]",",","optional",")",":","list","of","tag","labels"]
docstr: Run model training
  
  Args:
      train_data_set (DataLoader): training dataset
      dev_data_set (Union[DataLoader, List[DataLoader]], optional): development data set
      (can be list). Defaults to None.
      test_data_set (Union[DataLoader, List[DataLoader]], optional): test data set
      (can be list). Defaults to None.
      gradient_accumulation_steps (int, optional): gradient accumulation steps.
      Defaults to 1.
      per_gpu_train_batch_size (int, optional): per GPU train batch size (or GPU).
      Defaults to 8.
      max_steps (int, optional): max steps for training. Defaults to -1.
      num_train_epochs (int, optional): number of training epochs. Defaults to 3.
      max_grad_norm (float, optional): max gradient norm. Defaults to 1.0.
      logging_steps (int, optional): number of steps between logging. Defaults to 50.
      save_steps (int, optional): number of steps between model save. Defaults to 100.
      best_result_file (str, optional): path to save best dev results when it's updated.
docstr_tok: ["Run","model","training","Args",":","train_data_set","(","DataLoader",")",":","training","dataset","dev_data_set","(","Union","[","DataLoader",",","List","[","DataLoader","]","]",",","optional",")",":","development","data","set","(","can","be","list",")",".","Defaults","to","None",".","test_data_set","(","Union","[","DataLoader",",","List","[","DataLoader","]","]",",","optional",")",":","test","data","set","(","can","be","list",")",".","Defaults","to","None",".","gradient_accumulation_steps","(","int",",","optional",")",":","gradient","accumulation","steps",".","Defaults","to","1.","per_gpu_train_batch_size","(","int",",","optional",")",":","per","GPU","train","batch","size","(","or","GPU",")",".","Defaults","to","8.","max_steps","(","int",",","optional",")",":","max","steps","for","training",".","Defaults","to","-1.","num_train_epochs","(","int",",","optional",")",":","number","of","training","epochs",".","Defaults","to","3.","max_grad_norm","(","float",",","optional",")",":","max","gradient","norm",".","Defaults","to","1.0.","logging_steps","(","int",",","optional",")",":","number","of","steps","between","logging",".","Defaults","to","50.","save_steps","(","int",",","optional",")",":","number","of","steps","between","model","save",".","Defaults","to","100.","best_result_file","(","str",",","optional",")",":","path","to","save","best","dev","results","when","it","'s","updated","."]
code: def train(
      self,
      train_data_set: DataLoader,
      dev_data_set: Union[DataLoader, List[DataLoader]] = None,
      test_data_set: Union[DataLoader, List[DataLoader]] = None,
      gradient_accumulation_steps: int = 1,
      per_gpu_train_batch_size: int = 8,
      max_steps: int = -1,
      num_train_epochs: int = 3,
      max_grad_norm: float = 1.0,
      logging_steps: int = 50,
      save_steps: int = 100,
      best_result_file: str = None,
  ):
      """
      Run model training
  
      Args:
          train_data_set (DataLoader): training dataset
          dev_data_set (Union[DataLoader, List[DataLoader]], optional): development data set
          (can be list). Defaults to None.
          test_data_set (Union[DataLoader, List[DataLoader]], optional): test data set
          (can be list). Defaults to None.
          gradient_accumulation_steps (int, optional): gradient accumulation steps.
          Defaults to 1.
          per_gpu_train_batch_size (int, optional): per GPU train batch size (or GPU).
          Defaults to 8.
          max_steps (int, optional): max steps for training. Defaults to -1.
          num_train_epochs (int, optional): number of training epochs. Defaults to 3.
          max_grad_norm (float, optional): max gradient norm. Defaults to 1.0.
          logging_steps (int, optional): number of steps between logging. Defaults to 50.
          save_steps (int, optional): number of steps between model save. Defaults to 100.
          best_result_file (str, optional): path to save best dev results when it's updated.
      """
      self._train(
          train_data_set,
          dev_data_set,
          test_data_set,
          gradient_accumulation_steps,
          per_gpu_train_batch_size,
          max_steps,
          num_train_epochs,
          max_grad_norm,
          logging_steps=logging_steps,
          save_steps=save_steps,
          best_result_file=best_result_file,
      )
  
imports: import logging
  from typing import List, Union
  import torch
  from torch.nn import CrossEntropyLoss, Dropout, Linear
  from torch.nn import functional
  from torch.utils.data import DataLoader, SequentialSampler, TensorDataset
  from transformers import ROBERTA_PRETRAINED_MODEL_ARCHIVE_MAP, BertForTokenClassification, BertPreTrainedModel, RobertaConfig, RobertaModel, XLNetModel, XLNetPreTrainedModel
  from nlp_architect.data.sequential_tagging import TokenClsInputExample
  from nlp_architect.models.transformers.base_model import InputFeatures, TransformerBase
  from nlp_architect.models.transformers.quantized_bert import QuantizedBertForTokenClassification
  from nlp_architect.utils.metrics import tagging
label_desc: Use image node_id 2 for calling the TransformerTokenClassifier obj's underlying member method code with example usage: obj.train(train_data_set, dev_data_set, test_data_set, gradient_accumulation_steps, per_gpu_train_batch_size, max_steps, num_train_epochs, max_grad_norm, logging_steps, save_steps, best_result_file) without return types