class_docstr: The [`Evaluator`] class is the class from which all evaluators inherit. Refer to this class for methods shared across
  different evaluators.
  Base class implementing evaluator operations.
class_docstr_tok: ["The","[","`","Evaluator","`","]","class","is","the","class","from","which","all","evaluators","inherit",".","Refer","to","this","class","for","methods","shared","across","different","evaluators",".","Base","class","implementing","evaluator","operations","."]
code: def compute(
      self,
      model_or_pipeline: Union[
          str,
          "Pipeline",
          Callable,
          "PreTrainedModel",
          "TFPreTrainedModel",  # noqa: F821
      ] = None,
      data: Union[str, Dataset] = None,
      subset: Optional[str] = None,
      split: Optional[str] = None,
      metric: Union[str, EvaluationModule] = None,
      tokenizer: Optional[
          Union[str, "PreTrainedTokenizer"]
      ] = None,  # noqa: F821
      feature_extractor: Optional[
          Union[str, "FeatureExtractionMixin"]
      ] = None,  # noqa: F821
      strategy: Literal["simple", "bootstrap"] = "simple",
      confidence_level: float = 0.95,
      n_resamples: int = 9999,
      device: int = None,
      random_state: Optional[int] = None,
      input_column: str = "text",
      label_column: str = "label",
      label_mapping: Optional[Dict[str, Number]] = None,
  ) -> Dict[str, float]:
      result = {}
  
      self.check_for_mismatch_in_device_setup(device, model_or_pipeline)
  
      # Prepare inputs
      data = self.load_data(data=data, subset=subset, split=split)
      metric_inputs, pipe_inputs = self.prepare_data(
          data=data,
          input_column=input_column,
          label_column=label_column,
      )
      pipe = self.prepare_pipeline(
          model_or_pipeline=model_or_pipeline,
          tokenizer=tokenizer,
          feature_extractor=feature_extractor,
          device=device,
      )
      metric = self.prepare_metric(metric)
  
      # Compute predictions
      predictions, perf_results = self.call_pipeline(pipe, pipe_inputs)
      predictions = self.predictions_processor(
          predictions, label_mapping
      )
  
      metric_inputs.update(predictions)
  
      # Compute metrics from references and predictions
      metric_results = self.compute_metric(
          metric=metric,
          metric_inputs=metric_inputs,
          strategy=strategy,
          confidence_level=confidence_level,
          n_resamples=n_resamples,
          random_state=random_state,
      )
  
      # TODO: To clarify why `wer` and `cer` return float
      # even though metric.compute contract says that it
      # returns Optional[dict].
      if type(metric_results) is float:
          metric_results = {metric.name: metric_results}
  
      result.update(metric_results)
      result.update(perf_results)
  
      return result
  
imports: from abc import ABC, abstractmethod
  from numbers import Number
  from typing import Any, Callable, Dict, List, Optional, Union
  from datasets import Dataset, load_dataset
  from evaluate.evaluator.utils import choose_split
  from time import perf_counter
  from typing_extensions import Literal
  from ..loading import load
  from ..module import EvaluationModule
  from ..utils.logging import get_logger
  from .utils import DatasetColumn
label_desc: Use image node_id 6 for calling the Evaluator obj's underlying member method code with example usage: obj.compute(model_or_pipeline, data, subset, split, metric, tokenizer, feature_extractor, strategy, confidence_level, n_resamples, device, random_state, input_column, label_column, label_mapping) and returns: result