docstr: Calculates exact match and f1 scores for all predictions, 
      questions with answers, and no answer questions
docstr_tok: ["Calculates","exact","match","and","f1","scores","for","all","predictions",",","questions","with","answers",",","and","no","answer","questions"]
code: def evaluate_predictions(examples, all_predictions):
      """
      Calculates exact match and f1 scores for all predictions,
          questions with answers, and no answer questions
      """
  
      qas_id_to_has_answer = {
          example.qas_id: bool(example.answers)
          for example in examples[: len(all_predictions)]
      }
      has_answer_qids = [
          qas_id
          for qas_id, has_answer in qas_id_to_has_answer.items()
          if has_answer
      ]
      no_answer_qids = [
          qas_id
          for qas_id, has_answer in qas_id_to_has_answer.items()
          if not has_answer
      ]
  
      filters_and_prefixes = [
          (list(qas_id_to_has_answer), ""),
          (has_answer_qids, "HasAns_"),
          (no_answer_qids, "NoAns_"),
      ]
  
      eval_dicts = []
      for qas_id_filter, prefix in filters_and_prefixes:
          curr_exact, curr_f1 = QAMetrics.get_exact_match_and_f1(
              examples, all_predictions, qas_id_filter
          )
          curr_eval_dict = QAMetrics.make_eval_dict(
              curr_exact, curr_f1, prefix=prefix
          )
          eval_dicts.append(curr_eval_dict)
  
      merged_eval_dict = QAMetrics.merge_eval_dicts(eval_dicts)
  
      return merged_eval_dict
  
imports: import collections
  import json
  import re
  import string
  import torch
  from tqdm import tqdm
  from nemo.collections.nlp.parts.utils_funcs import tensor2list
  from nemo.utils import logging
label_desc: Use image node_id 12 for calling the QAMetrics obj's underlying member method code with example usage: obj.evaluate_predictions(examples, all_predictions) and returns: merged_eval_dict