code: def _remap_keras_metric(metric: str, task) -> str:
      # we do not support sparse label in classification.
      lookup = {
          matchzoo.tasks.Ranking: {
              "acc": "binary_accuracy",
              "accuracy": "binary_accuracy",
              "crossentropy": "binary_crossentropy",
              "ce": "binary_crossentropy",
          },
          matchzoo.tasks.Classification: {
              "acc": "categorical_accuracy",
              "accuracy": "categorical_accuracy",
              "crossentropy": "categorical_crossentropy",
              "ce": "categorical_crossentropy",
          },
      }
      return lookup[type(task)].get(metric, metric)
  
imports: import typing
  import matchzoo
  from matchzoo.engine.base_metric import BaseMetric
  from matchzoo.engine import base_task
label_desc: Use image node_id 2 for calling a global function with example usage: _remap_keras_metric(metric, task) and returns: lookup