code: def classification_score(prediction, reference, **kwargs):
      em_match_list = []
      all_classes = kwargs["all_classes"]
      for class_name in all_classes:
          if class_name in prediction:
              em_match_list.append(class_name)
      for match_term in em_match_list:
          if match_term in reference and match_term != reference:
              em_match_list.remove(match_term)
      if em_match_list != 0:
          if reference in em_match_list:
              score = 1.0 / len(em_match_list)
          else:
              score = 0.0
      else:
          best_match = None
          highest_similarity = 0
          for string in all_classes:
              similarity = difflib.SequenceMatcher(
                  None, string, prediction
              ).ratio()
              if similarity > highest_similarity:
                  highest_similarity = similarity
                  best_match = string
          score = float(best_match == reference)
      return score
  
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 18 for calling a global function with example usage: classification_score(prediction, reference) and returns: score