code: def test_matcher_basic(
      dataset_name,
      query,
      response,
      problem_type,
      text_backbone,
      image_backbone,
      is_ranking,
      symmetric,
  ):
      dataset = ALL_DATASETS[dataset_name]()
  
      matcher = MultiModalPredictor(
          query=query,
          response=response,
          problem_type=problem_type,
          label=dataset.label_columns[0]
          if dataset.label_columns
          else None,
          match_label=dataset.match_label,
          eval_metric=dataset.metric,
      )
  
      hyperparameters = {
          "optimization.max_epochs": 1,
          "env.num_workers": 0,
          "env.num_workers_evaluation": 0,
          "optimization.top_k_average_method": "greedy_soup",
      }
  
      if text_backbone is not None:
          hyperparameters.update(
              {
                  "model.hf_text.checkpoint_name": text_backbone,
              }
          )
      if image_backbone is not None:
          hyperparameters.update(
              {
                  "model.timm_image.checkpoint_name": image_backbone,
              }
          )
  
      save_path = os.path.join(get_home_dir(), "outputs", dataset_name)
      if os.path.exists(save_path):
          shutil.rmtree(save_path)
  
      matcher.fit(
          train_data=dataset.train_df,
          tuning_data=dataset.val_df
          if hasattr(dataset, "val_df")
          else None,
          hyperparameters=hyperparameters,
          time_limit=20,
          save_path=save_path,
      )
  
      if is_ranking:
          evaluate_matcher_ranking(
              matcher=matcher,
              test_df=dataset.test_df,
              query_column=query,
              response_column=response,
              metric_name=dataset.metric,
              symmetric=symmetric,
          )
          text_to_image_hits = semantic_search(
              matcher=matcher,
              query_data={
                  query: dataset.test_df[query].tolist()
              },  # need a dict/dataframe instead of a list for a trained matcher
              response_data={
                  response: dataset.test_df[response].tolist()
              },  # need a dict/dataframe instead of a list for a trained matcher
              top_k=5,
          )
          image_to_text_hits = semantic_search(
              matcher=matcher,
              query_data={
                  response: dataset.test_df[response].tolist()
              },  # need a dict/dataframe instead of a list for a trained matcher
              response_data={
                  query: dataset.test_df[query].tolist()
              },  # need a dict/dataframe instead of a list for a trained matcher
              top_k=5,
          )
      else:
          score = matcher.evaluate(dataset.test_df)
      verify_matcher_save_load(
          matcher, dataset.test_df, cls=MultiModalPredictor
      )
  
      # Test for continuous fit
      matcher.fit(
          train_data=dataset.train_df,
          tuning_data=dataset.val_df
          if hasattr(dataset, "val_df")
          else None,
          hyperparameters=hyperparameters,
          time_limit=20,
      )
      verify_matcher_save_load(
          matcher, dataset.test_df, cls=MultiModalPredictor
      )
  
      # Saving to folder, loading the saved model and call fit again (continuous fit)
      with tempfile.TemporaryDirectory() as root:
          matcher.save(root)
          matcher = MultiModalPredictor.load(root)
          matcher.fit(
              train_data=dataset.train_df,
              tuning_data=dataset.val_df
              if hasattr(dataset, "val_df")
              else None,
              hyperparameters=hyperparameters,
              time_limit=20,
          )
  
file_path: autogluon/multimodal/tests/unittests/others/test_matcher.py
imports: import copy
  import os
  import pickle
  import shutil
  import tempfile
  import numpy.testing
  import pytest
  from autogluon.multimodal import MultiModalPredictor
  from autogluon.multimodal.constants import BINARY, MULTICLASS, QUERY, RESPONSE, UNIFORM_SOUP
  from autogluon.multimodal.utils import convert_data_for_ranking, semantic_search
  from ..utils.unittest_datasets import Flickr30kDataset, IDChangeDetectionDataset
  from ..utils.utils import get_home_dir
label_desc: Use image node_id 5 for calling a global function with example usage: test_matcher_basic(dataset_name, query, response, problem_type, text_backbone, image_backbone, is_ranking, symmetric) without return types