docstr: evaluate on the given dataset
  Returns
  -------
  evaluation dictionary
docstr_tok: ["evaluate","on","the","given","dataset","Returns","--","--","--","-","evaluation","dictionary"]
code: def run(
      self,
      *,
      gt_dataset: CalamariDataGeneratorParams,
      pred_dataset: CalamariDataGeneratorParams,
  ):
      """evaluate on the given dataset
      Returns
      -------
      evaluation dictionary
      """
      if self.preloaded_gt:
          gt_data = self.preloaded_gt
      else:
          pipeline = self.data.create_pipeline(
              self.params.setup, gt_dataset
          ).generate_input_samples()
          with pipeline as samples:
              gt_data = {
                  sample.meta["id"]: sample.targets
                  for sample in tqdm_wrapper(
                      samples,
                      total=len(pipeline),
                      progress_bar=self.params.progress_bar,
                      desc="Loading GT",
                  )
              }
  
      pipeline = self.data.create_pipeline(
          self.params.setup, pred_dataset
      ).generate_input_samples()
      with pipeline as samples:
          pred_data = {
              sample.meta["id"]: sample.targets
              for sample in tqdm_wrapper(
                  samples,
                  total=len(pipeline),
                  progress_bar=self.params.progress_bar,
                  desc="Loading Prediction",
              )
          }
  
      return self.evaluate(gt_data=gt_data, pred_data=pred_data)
  
file_path: calamari/calamari_ocr/ocr/evaluator.py
imports: from dataclasses import dataclass, field
  from typing import Dict, TYPE_CHECKING
  import logging
  from edit_distance import edit_distance
  from collections import namedtuple
  from paiargparse import pai_dataclass, pai_meta
  from tfaip.data.databaseparams import DataPipelineParams
  from tfaip.data.pipeline.definitions import PipelineMode
  from tfaip.util.multiprocessing.parallelmap import parallel_map, tqdm_wrapper
  from calamari_ocr.ocr.dataset.datareader.base import CalamariDataGeneratorParams
  from calamari_ocr.ocr.dataset.textprocessors import synchronize
label_desc: Use image node_id 3 for calling the Evaluator obj's underlying member method code with example usage: obj.run() and returns: self