code: def compute_crf_loss(
      self, potentials, sequence_length, kernel, y, sample_weight=None
  ):
      crf_likelihood, _ = crf_log_likelihood(
          potentials, y, sequence_length, kernel
      )
      # convert likelihood to loss
      flat_crf_loss = -1 * crf_likelihood
      if sample_weight is not None:
          flat_crf_loss = flat_crf_loss * sample_weight
      crf_loss = tf.reduce_mean(flat_crf_loss)
  
      return crf_loss
  
file_path: addons/tensorflow_addons/text/crf_wrapper.py
imports: import tensorflow
  from tensorflow_addons.text import crf_log_likelihood
  from tensorflow_addons.utils import types
label_desc: Use image node_id 4 for calling the CRFModelWrapper obj's underlying member method code with example usage: obj.compute_crf_loss(potentials, sequence_length, kernel, y, sample_weight) and returns: crf_loss