code: def _f1_score(prediction, reference, **kwargs):
      common = Counter(prediction) & Counter(reference)
      num_same = sum(common.values())
      if num_same == 0:
          return 0
      precision = 1.0 * num_same / len(prediction)
      recall = 1.0 * num_same / len(reference)
      f1 = (2 * precision * recall) / (precision + recall)
      return f1
  
imports: import difflib
  import re
  import string
  from collections import Counter
  import jieba
  from fuzzywuzzy import fuzz
  from rouge import Rouge
label_desc: Use image node_id 21 for calling a global function with example usage: _f1_score(prediction, reference) and returns: f1, int