docstr: Preload gt to be used for several experiments
  
  Use this method to specify ground truth data to be tested versus many predictions
  
  Parameters
  ----------
  gt_dataset : Dataset
      the ground truth
  progress_bar : bool, optional
      show a progress bar
docstr_tok: ["Preload","gt","to","be","used","for","several","experiments","Use","this","method","to","specify","ground","truth","data","to","be","tested","versus","many","predictions","Parameters","--","--","--","--","--","gt_dataset",":","Dataset","the","ground","truth","progress_bar",":","bool",",","optional","show","a","progress","bar"]
code: def preload_gt(
      self, gt_dataset: CalamariDataGeneratorParams, progress_bar=False
  ):
      """Preload gt to be used for several experiments
  
      Use this method to specify ground truth data to be tested versus many predictions
  
      Parameters
      ----------
      gt_dataset : Dataset
          the ground truth
      progress_bar : bool, optional
          show a progress bar
  
      """
      pipeline = self.data.create_pipeline(
          self.params.setup, gt_dataset
      ).generate_input_samples()
      with pipeline as samples:
          self.preloaded_gt = {
              sample.meta["id"]: sample.targets
              for sample in tqdm_wrapper(
                  samples,
                  total=len(pipeline),
                  progress_bar=progress_bar,
                  desc="Loading GT",
              )
          }
  
      if len(self.preloaded_gt) == 0:
          raise ValueError("Empty GT dataset.")
  
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 2 for calling the Evaluator obj's underlying member method code with example usage: obj.preload_gt(gt_dataset, progress_bar) without return types