class_docstr: A training module for NER. See BaseTransformer for the core options.
code: def test_epoch_end(self, outputs):
      # updating to test_epoch_end instead of deprecated test_end
      ret, predictions, targets = self._eval_end(outputs)
  
      # Converting to the dict required by pl
      # https://github.com/PyTorchLightning/pytorch-lightning/blob/master/\
      # pytorch_lightning/trainer/logging.py#L139
      logs = ret["log"]
      # `val_loss` is the key returned by `self._eval_end()` but actually refers to `test_loss`
      return {
          "avg_test_loss": logs["val_loss"],
          "log": logs,
          "progress_bar": logs,
      }
  
imports: import argparse
  import glob
  import logging
  import os
  from argparse import Namespace
  from importlib import import_module
  import numpy
  import torch
  from seqeval.metrics import accuracy_score, f1_score, precision_score, recall_score
  from torch.nn import CrossEntropyLoss
  from torch.utils.data import DataLoader, TensorDataset
  from lightning_base import BaseTransformer, add_generic_args, generic_train
  from utils_ner import TokenClassificationTask
label_desc: Use image node_id 9 for calling the NERTransformer obj's underlying member method code with example usage: obj.test_epoch_end(outputs) and returns: dict