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 call(self, inputs, sequence_lengths=None, **kwargs):
      sequences = tf.convert_to_tensor(inputs, dtype=self.dtype)
      if sequence_lengths is not None:
          assert len(sequence_lengths.shape) == 2
          assert tf.convert_to_tensor(sequence_lengths).dtype == "int32"
          seq_len_shape = (
              tf.convert_to_tensor(sequence_lengths)
              .get_shape()
              .as_list()
          )
          assert seq_len_shape[1] == 1
          self.sequence_lengths = tf.keras.backend.flatten(
              sequence_lengths
          )
      else:
          self.sequence_lengths = tf.ones(
              tf.shape(inputs)[0], dtype=tf.int32
          ) * (tf.shape(inputs)[1])
  
      viterbi_sequence, _ = tf.contrib.crf.crf_decode(
          sequences, self.transitions, self.sequence_lengths
      )
      output = tf.keras.backend.one_hot(
          viterbi_sequence, self.output_dim
      )
      return tf.keras.backend.in_train_phase(sequences, output)
  
file_path: nlp-architect/nlp_architect/nn/tensorflow/python/keras/layers/crf.py
imports: import tensorflow
label_desc: Use image node_id 4 for calling the CRF obj's underlying member method code with example usage: obj.call(inputs, sequence_lengths) and returns: tf