class_docstr: Base class for LIT metrics components.
class_docstr_tok: ["Base","class","for","LIT","metrics","components","."]
docstr: True if the model and dataset support metric computation.
docstr_tok: ["True","if","the","model","and","dataset","support","metric","computation","."]
code: def is_compatible(
      self, model: lit_model.Model, dataset: lit_dataset.Dataset
  ) -> bool:
      """True if the model and dataset support metric computation."""
      for pred_spec in model.output_spec().values():
          parent_key: Optional[str] = getattr(pred_spec, "parent", None)
          parent_spec: Optional[types.LitType] = dataset.spec().get(
              parent_key
          )
          if self.is_field_compatible(pred_spec, parent_spec):
              return True
      return False
  
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 1 for calling the Metrics obj's underlying member method code with example usage: obj.is_compatible(model, dataset) and returns: False, True