class_docstr: Base class for LIT metrics components.
class_docstr_tok: ["Base","class","for","LIT","metrics","components","."]
docstr: Compute metric(s) given labels and predictions.
docstr_tok: ["Compute","metric","(","s",")","given","labels","and","predictions","."]
code: def compute(
      self,
      labels: Sequence[Any],
      preds: Sequence[Any],
      label_spec: types.LitType,
      pred_spec: types.LitType,
      config: Optional[JsonDict] = None,
      indices: Optional[Sequence[types.ExampleId]] = None,
      metas: Optional[Sequence[JsonDict]] = None,
  ) -> MetricsDict:
      """Compute metric(s) given labels and predictions."""
      raise NotImplementedError(
          "Subclass should implement this, or override "
          "run() directly."
      )
  
imports: import abc
  from collections.abc import Sequence
  import inspect
  from typing import Any, Optional
  from lit_nlp.api import dataset
  from lit_nlp.api import model
  from lit_nlp.api import types
label_desc: Use image node_id 4 for calling the Metrics obj's underlying member method code with example usage: obj.compute(labels, preds, label_spec, pred_spec, config, indices, metas) without return types