code: def get_results(self, data_id, token_ids, pred_ids, probs):
      data_id = data_id.numpy()
      token_ids = token_ids.numpy()
      pred_ids = pred_ids.numpy()
      probs = probs.numpy()
  
      infos = []
      for raw, pred, prob in zip(token_ids, pred_ids, probs):
          tokens = post_process_context(raw, self.nsp_reader)
          pred_token_ids, pred_tokens = post_process_response(
              pred, self.nsp_reader
          )
          info = {}
          info["response"] = " ".join(pred_tokens)
          cross_turn_repetition = get_cross_turn_repetition(
              tokens, pred_tokens, self.nsp_reader.eos_id, self.is_cn
          )
          in_turn_repetition = max(
              get_in_turn_repetition(pred_tokens, self.is_cn),
              get_in_turn_repetition(pred_token_ids),
          )
  
          info["score"] = float(prob[1])
          if len(pred_token_ids) >= self.max_dec_len:
              info["score"] -= 1e3
          elif cross_turn_repetition > 0:
              info["score"] -= 1e3
          elif in_turn_repetition > 0:
              info["score"] -= 1e3
          infos.append(info)
  
      results = []
      pre_idx = 0
      sample = []
      for idx, info in zip(data_id, infos):
          if idx != pre_idx:
              sample = sorted(sample, key=lambda info: -info["score"])
              result = sample[0]
              result["data_id"] = pre_idx
              results.apeend(result)
              sample = []
              pre_idx = idx
          sample.append(info)
      if sample:
          sample = sorted(sample, key=lambda info: -info["score"])
          result = sample[0]
          result["data_id"] = pre_idx
          results.append(result)
      return results
  
imports: from collections import namedtuple
  import paddle
  import paddle.nn
  import paddle.nn.functional
label_desc: Use image node_id 5 for calling the Plato2InferModel obj's underlying member method code with example usage: obj.get_results(data_id, token_ids, pred_ids, probs) and returns: results