code: def get_evaluation_metrics(
      targets: Iterable[Any],
      predictions: Iterable[Any],
      output_dict: bool = False,
      exclude_label: Optional[Text] = None,
  ) -> Tuple[
      Union[Text, Dict[Text, Dict[Text, float]]], float, float, float
  ]:
      """Compute the f1, precision, accuracy and summary report from sklearn.
  
      Args:
          targets: target labels
          predictions: predicted labels
          output_dict: if True sklearn returns a summary report as dict, if False the
            report is in string format
          exclude_label: labels to exclude from evaluation
  
      Returns:
          Report from sklearn, precision, f1, and accuracy values.
      """
      from sklearn import metrics
  
      targets = clean_labels(targets)
      predictions = clean_labels(predictions)
  
      labels = get_unique_labels(targets, exclude_label)
      if not labels:
          logger.warning("No labels to evaluate. Skip evaluation.")
          return {}, 0.0, 0.0, 0.0
  
      report = metrics.classification_report(
          targets, predictions, labels=labels, output_dict=output_dict
      )
      precision = metrics.precision_score(
          targets, predictions, labels=labels, average="weighted"
      )
      f1 = metrics.f1_score(
          targets, predictions, labels=labels, average="weighted"
      )
      accuracy = metrics.accuracy_score(targets, predictions)
  
      if output_dict:
          report = make_classification_report_complete(report, accuracy)
  
      return report, precision, f1, accuracy
  
imports: import copy
  import logging
  import os
  from typing import Text, Dict, Optional, List, Any, Iterable, Tuple, Union
  from pathlib import Path
  from rasa.core.agent import Agent
  from rasa.engine.storage.local_model_storage import LocalModelStorage
  import rasa.shared.utils.cli
  import rasa.shared.utils.common
  import rasa.shared.utils.io
  import rasa.utils.common
  from rasa.constants import RESULTS_FILE, NUMBER_OF_TRAINING_STORIES_FILE
  from rasa.exceptions import ModelNotFound
  from rasa.shared.constants import DEFAULT_RESULTS_PATH
  import rasa.shared.nlu.training_data.loading
  from rasa.shared.data import TrainingType
  from rasa.shared.nlu.training_data.training_data import TrainingData
  import rasa.model
label_desc: Use image node_id 4 for calling a global function with example usage: get_evaluation_metrics(targets, predictions, output_dict, exclude_label) and returns: report,  precision,  f1,  accuracy, dict,  int,  int,  int