class_docstr: Conditional Random Field layer (tf.keras)
  `CRF` can be used as the last layer in a network (as a classifier). Input shape (features)
  must be equal to the number of classes the CRF can predict (a linear layer is recommended).
  
  Note: the loss and accuracy functions of networks using `CRF` must
  use the provided loss and accuracy functions (denoted as loss and viterbi_accuracy)
  as the classification of sequences are used with the layers internal weights.
  
  Args:
      num_labels (int): the number of labels to tag each temporal input.
  
  Input shape:
      nD tensor with shape `(batch_size, sentence length, num_classes)`.
  
  Output shape:
      nD tensor with shape: `(batch_size, sentence length, num_classes)`.
code: def loss(self, y_true, y_pred):
      y_pred = tf.convert_to_tensor(y_pred, dtype=self.dtype)
      (
          log_likelihood,
          self.transitions,
      ) = tf.contrib.crf.crf_log_likelihood(
          y_pred,
          tf.cast(tf.keras.backend.argmax(y_true), dtype=tf.int32),
          self.sequence_lengths,
          transition_params=self.transitions,
      )
      return tf.reduce_mean(-log_likelihood)
  
file_path: nlp-architect/nlp_architect/nn/tensorflow/python/keras/layers/crf.py
imports: import tensorflow
label_desc: Use image node_id 5 for calling the CRF obj's underlying member method code with example usage: obj.loss(y_true, y_pred) and returns: tf