code: def crf_log_likelihood(
      tags_scores, labels, input_length, transitions
  ):
      """
      :param tags_scores:  [batch_size, max_seq_len, num_tags]
      :param labels:  [batch_size, max_seq_len]
      :param input_length:  [batch_size,]
      :param transitions: [num_tags, num_tags]
      :return: loss, transition_params
      """
      log_likelihood, transition_params = tfa.text.crf_log_likelihood(
          inputs=tags_scores,
          tag_indices=labels,
          sequence_lengths=input_length,
          transition_params=transitions,
      )
  
      loss = tf.reduce_mean(-log_likelihood)
  
      return loss, transition_params
  
file_path: delta/delta/utils/loss/loss_utils.py
imports: import math
  import delta.compat
  import tensorflow_addons
  from delta import utils
  from delta.utils import ctc_utils
label_desc: Use image node_id 4 for calling a global function with example usage: crf_log_likelihood(tags_scores, labels, input_length, transitions) and returns: loss,  transition_params