Pip Install Torchcrf, currentmodule:: torchcrf pytorch-crf exposes a single CRF class which inherits from PyTorch's nn.