code: def instance_has_changed(
      instance: Instance, fields_to_compare: JsonDict
  ):
      if "clusters" in fields_to_compare:
          # Coref needs a special case here, apparently.  I (mattg) am not sure why the check below
          # doesn't catch this case; TODO: look into this.
          original_clusters = set(
              tuple(x) for x in fields_to_compare["clusters"]
          )
          new_clusters = set(tuple(x) for x in instance["clusters"])  # type: ignore
          return original_clusters != new_clusters
      if any(
          instance[field] != fields_to_compare[field]
          for field in fields_to_compare
      ):
          return True
      return False
  
imports: from allennlp.common.util import JsonDict
  from allennlp.data import Instance
label_desc: Use image node_id 2 for calling a global function with example usage: instance_has_changed(instance, fields_to_compare) and returns: False, unknown, True