class_docstr: RoBERTa token classification head with linear classifier.
  This head's forward ignores word piece tokens in its linear layer.
  
  The forward requires an additional 'valid_ids' map that maps the tensors
  for valid tokens (e.g., ignores additional word piece tokens generated by
  the tokenizer, as in NER task the 'X' label).
class_docstr_tok: ["RoBERTa","token","classification","head","with","linear","classifier",".","This","head","'s","forward","ignores","word","piece","tokens","in","its","linear","layer",".","The","forward","requires","an","additional","'valid_ids","'","map","that","maps","the","tensors","for","valid","tokens","(","e.g.",",","ignores","additional","word","piece","tokens","generated","by","the","tokenizer",",","as","in","NER","task","the","'","X","'","label",")","."]
code: def __init__(self, config):
      super(RobertaForTokenClassificationHead, self).__init__(config)
      self.num_labels = config.num_labels
  
      self.roberta = RobertaModel(config)
      self.dropout = Dropout(config.hidden_dropout_prob)
      self.classifier = Linear(config.hidden_size, config.num_labels)
  
      self.init_weights()
  
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 1 to create a new RobertaForTokenClassificationHead object from inherited base classes: BertPreTrainedModel with example: obj = RobertaForTokenClassificationHead(config)