code: def eval_classification(self, dataset, n_debug):
      if n_debug is None:
          n_debug = len(dataset)
      examples = [item for item in dataset][:n_debug]
  
      prompts = [
          self.format_fn(example.prompt) + class_seq
          for example in examples
          for class_seq in example.classes
      ]
      target_token_lengths = [
          len(self.tokenizer.encode(class_seq))
          for example in examples
          for class_seq in example.classes
      ]
  
      _, ll = self.get_conditional_loglikelihood_batch(
          prompts, completion_offset=torch.tensor(target_token_lengths)
      )
      pred_logprobs = ll.reshape((len(examples), -1))
      total_logprob = logsumexp(pred_logprobs, axis=1)
      normalised_logprobs = log_softmax(pred_logprobs, axis=1)
      pred_classes = np.argmax(pred_logprobs, axis=1)
      labels = np.array([e.answer_index for e in examples])
      losses = -normalised_logprobs[np.arange(labels.shape[0]), labels]
      metrics = {
          "Accuracy": (pred_classes == labels),
          "Loss": losses,
          "TotalProbSpanned": total_logprob,
      }
      return metrics
  
file_path: interpret-text/python/interpret_text/generative/model_lib/openai_tooling.py
imports: import tiktoken
  import openai
  from tqdm import tqdm
  import time
  import torch
  import numpy
  from scipy.special import logsumexp, log_softmax
label_desc: Use image node_id 6 for calling the CompletionsOpenAI obj's underlying member method code with example usage: obj.eval_classification(dataset, n_debug) and returns: metrics