code: def calculate_validation_metric(
      valid: Union[InputData, MultiModalData], pred: OutputData
  ) -> float:
      """
      Calculates F1 score for predicted data
  
      :param valid: dataclass with true target
      :param pred: dataclass with model's prediction
      """
  
      real = valid.target
      predicted = pred.predict
  
      err = f1(y_true=real, y_pred=predicted, average="micro")
  
      return round(err, 2)
  
file_path: FEDOT/examples/advanced/multi_modal_pipeline.py
imports: import os
  from typing import Union
  from sklearn.metrics import f1_score
  from cases.dataset_preparation import unpack_archived_data
  from fedot import Fedot
  from fedot.core.data.data import InputData, OutputData
  from fedot.core.data.data_split import train_test_data_setup
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum
  from fedot.core.utils import fedot_project_root
label_desc: Use image node_id 1 for calling a global function with example usage: calculate_validation_metric(valid, pred) and returns: round