Conditional random field (CRF) implementation consists of three parts:
- The trainable layer, which contains the transition probabilities of the random field.
- The loss function that should be optimized by training.
- The special layer that provides the highest-probability sequences from the output of the trained CRF layer.