docstr: Returns a dictionary of question id: exact match/f1 score
  Questions with ids *not* present in `question_id_filter` are excluded
docstr_tok: ["Returns","a","dictionary","of","question","id",":","exact","match\/f1","score","Questions","with","ids","*","not","*","present","in","`","question_id_filter","`","are","excluded"]
code: def get_exact_match_and_f1(examples, preds, question_id_filter=[]):
      """
      Returns a dictionary of question id: exact match/f1 score
      Questions with ids *not* present in `question_id_filter` are excluded
      """
      exact_scores = {}
      f1_scores = {}
  
      for example in examples:
          question_id = example.qas_id
          if question_id not in question_id_filter:
              continue
  
          gold_answers = [
              answer["text"]
              for answer in example.answers
              if QAMetrics.normalize_answer(answer["text"])
          ]
  
          if not gold_answers:
              # For unanswerable questions, only correct answer is empty string
              gold_answers = [""]
  
          pred = preds[question_id]
          exact_scores[question_id] = max(
              QAMetrics.get_one_exact_match(pred, a)
              for a in gold_answers
          )
          f1_scores[question_id] = max(
              QAMetrics.get_one_f1(pred, a) for a in gold_answers
          )
  
      return exact_scores, f1_scores
  
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 9 for calling the QAMetrics obj's underlying member method code with example usage: obj.get_exact_match_and_f1(examples, preds, question_id_filter) and returns: exact_scores,  f1_scores