class_docstr: This suite was built using the checklist process with the self.editor
  suggestions. Users are encouraged to add/modify as they see fit.
  
  Note: `editor.suggest(...)` can be slow as it runs a language model.
class_docstr_tok: ["This","suite","was","built","using","the","checklist","process","with","the","self.editor","suggestions",".","Users","are","encouraged","to","add\/modify","as","they","see","fit",".","Note",":","`","editor.suggest","(","...",")","`","can","be","slow","as","it","runs","a","language","model","."]
code: def _prediction_and_confidence_scores(self, predictor: Predictor):
      def preds_and_confs_fn(data):
          labels = []
          confs = []
          if isinstance(data[0], Instance):
              predictions = predictor.predict_batch_instance(data)
          else:
              data = [{"sentence": sentence} for sentence in data]
              predictions = predictor.predict_batch_json(data)
          for pred in predictions:
              label = pred["probs"].index(max(pred["probs"]))
              labels.append(label)
              confs.append(pred["probs"])
          return np.array(labels), np.array(confs)
  
      return preds_and_confs_fn
  
imports: from typing import Optional, Iterable, List, Union, Tuple
  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.data.instance import Instance
  from allennlp.predictors import Predictor
label_desc: Use image node_id 2 for calling the SentimentAnalysisSuite obj's underlying member method code with example usage: obj._prediction_and_confidence_scores(predictor) and returns: preds_and_confs_fn, np,  np