class_docstr: Transformer sequence classifier
  
  Args:
      model_type (str): transformer base model type
      labels (List[str], optional): list of labels. Defaults to None.
      task_type (str, optional): task type (classification/regression). Defaults to
      classification.
      metric_fn ([type], optional): metric to use for evaluation. Defaults to
      simple_accuracy.
class_docstr_tok: ["Transformer","sequence","classifier","Args",":","model_type","(","str",")",":","transformer","base","model","type","labels","(","List","[","str","]",",","optional",")",":","list","of","labels",".","Defaults","to","None",".","task_type","(","str",",","optional",")",":","task","type","(","classification\/regression",")",".","Defaults","to","classification",".","metric_fn","(","[","type","]",",","optional",")",":","metric","to","use","for","evaluation",".","Defaults","to","simple_accuracy","."]
docstr: Run inference on given examples
  
  Args:
      examples (List[SequenceClsInputExample]): examples
      batch_size (int, optional): batch size. Defaults to 64.
  
  Returns:
      logits
docstr_tok: ["Run","inference","on","given","examples","Args",":","examples","(","List","[","SequenceClsInputExample","]",")",":","examples","batch_size","(","int",",","optional",")",":","batch","size",".","Defaults","to","64",".","Returns",":","logits"]
code: def inference(
      self,
      examples: List[SequenceClsInputExample],
      max_seq_length: int,
      batch_size: int = 64,
      evaluate=False,
  ):
      """
      Run inference on given examples
  
      Args:
          examples (List[SequenceClsInputExample]): examples
          batch_size (int, optional): batch size. Defaults to 64.
  
      Returns:
          logits
      """
      data_set = self.convert_to_tensors(
          examples,
          max_seq_length=max_seq_length,
          include_labels=evaluate,
      )
      inf_sampler = SequentialSampler(data_set)
      inf_dataloader = DataLoader(
          data_set, sampler=inf_sampler, batch_size=batch_size
      )
      logits = self._evaluate(inf_dataloader)
      if not evaluate:
          preds = self._postprocess_logits(logits)
      else:
          logits, label_ids = logits
          preds = self._postprocess_logits(logits)
          self.evaluate_predictions(logits, label_ids)
      return preds
  
file_path: nlp-architect/nlp_architect/models/transformers/sequence_classification.py
imports: import logging
  import os
  from typing import List, Union
  import numpy
  import torch
  from torch.utils.data import DataLoader, SequentialSampler, TensorDataset
  from transformers import BertForSequenceClassification, RobertaForSequenceClassification, XLMForSequenceClassification, XLNetForSequenceClassification
  from nlp_architect.data.sequence_classification import SequenceClsInputExample
  from nlp_architect.models.transformers.base_model import InputFeatures, TransformerBase
  from nlp_architect.models.transformers.quantized_bert import QuantizedBertForSequenceClassification
  from nlp_architect.utils.metrics import accuracy
label_desc: Use image node_id 5 for calling the TransformerSequenceClassifier obj's underlying member method code with example usage: obj.inference(examples, max_seq_length, batch_size, evaluate) and returns: preds