code: def _prediction_and_confidence_scores(self, predictor: Predictor):
      def preds_and_confs_fn(data):
          labels = []
          confs = []
  
          data = [
              {self._premise: pair[0], self._hypothesis: pair[1]}
              for pair in data
          ]
          predictions = predictor.predict_batch_json(data)
          for pred in predictions:
              label = np.argmax(pred[self._probs_key])
              labels.append(label)
              confs.append(pred[self._probs_key])
          return np.array(labels), np.array(confs)
  
      return preds_and_confs_fn
  
imports: from typing import Optional, Tuple, Iterable, Callable, Union
  import itertools
  import numpy
  from checklist.test_suite import TestSuite
  from checklist.test_types import MFT, INV, DIR, Expect
  from checklist.perturb import Perturb
  from allennlp.confidence_checks.task_checklists.task_suite import TaskSuite
  from allennlp.confidence_checks.task_checklists import utils
  from allennlp.predictors import Predictor
label_desc: Use image node_id 2 for calling the TextualEntailmentSuite obj's underlying member method code with example usage: obj._prediction_and_confidence_scores(predictor) and returns: preds_and_confs_fn, np,  np