code: def align_predictions(
      self,
      predictions: np.ndarray,
      label_ids: np.ndarray,
  ) -> Tuple[List[int], List[int]]:
      preds = np.argmax(predictions, axis=2)
  
      batch_size, seq_len = preds.shape
  
      out_label_list = [[] for _ in range(batch_size)]
      preds_list = [[] for _ in range(batch_size)]
  
      for i in range(batch_size):
          for j in range(seq_len):
              if label_ids[i, j] != nn.CrossEntropyLoss().ignore_index:
                  out_label_list[i].append(
                      self.data.label_map[label_ids[i][j]]
                  )
                  preds_list[i].append(self.data.label_map[preds[i][j]])
  
      return preds_list, out_label_list
  
imports: import os
  import logging
  import torch
  import numpy
  from .data_ner import BertNERDataBunch
  from torch import nn
  from seqeval.metrics import f1_score, precision_score, recall_score
  from typing import Dict, List, Optional, Tuple
  from .learner_util import Learner
  from transformers import AutoConfig, AutoModelForTokenClassification, Trainer, TrainingArguments, EvalPrediction, HfArgumentParser
label_desc: Use image node_id 9 for calling the BertNERLearner obj's underlying member method code with example usage: obj.align_predictions(predictions, label_ids) and returns: preds_list,  out_label_list