(tags_scores, labels, input_length, transitions)
return loss, transition_params
: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
: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
: 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
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
def crf_log_likelihood ( tags_scores , labels , input_length , transitions ) : 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