class_docstr: generated `pooled_video` and `pooled_text`.
class_docstr_tok: ["generated","`","pooled_video","`","and","`","pooled_text","`","."]
code: def finalize(self, output_file=None):
      outputs, targets = self._aggregate_scores(self.full_scores)
      if output_file is not None:
          np.save(
              os.path.join(self.pred_dir, output_file + ".npy"), outputs
          )
      return {"outputs": outputs, "targets": targets}
  
imports: import os
  import random
  import json
  import numpy
  import torch
  import pickle
  import math
  from tqdm import tqdm
label_desc: Use image node_id 4 for calling the QAPredictor obj's underlying member method code with example usage: obj.finalize(output_file) and returns: dict