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 evaluation of given logits and truth labels
  
  Args:
      logits: model logits
      label_ids: truth label ids
docstr_tok: ["Run","evaluation","of","given","logits","and","truth","labels","Args",":","logits",":","model","logits","label_ids",":","truth","label","ids"]
code: def evaluate_predictions(self, logits, label_ids):
      """
      Run evaluation of given logits and truth labels
  
      Args:
          logits: model logits
          label_ids: truth label ids
      """
      preds = self._postprocess_logits(logits)
      label_ids = label_ids.numpy()
      result = self.metric_fn(preds, label_ids)
      try:
          output_eval_file = os.path.join(
              self.output_path, "eval_results.txt"
          )
      except TypeError:
          output_eval_file = os.devnull
      with open(output_eval_file, "w") as writer:
          logger.info("***** Evaluation results *****")
          for key in sorted(result.keys()):
              logger.info("  %s = %s", key, str(result[key]))
              writer.write("%s = %s\n" % (key, str(result[key])))
  
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 3 for calling the TransformerSequenceClassifier obj's underlying member method code with example usage: obj.evaluate_predictions(logits, label_ids) without return types