CRF-package {CRF}R Documentation

CRF - Conditional Random Fields


Library of Conditional Random Fields model


CRF is R package for various computational tasks of conditional random fields as well as other probabilistic undirected graphical models of discrete data with pairwise and unary potentials. The decoding/inference/sampling tasks are implemented for general discrete undirected graphical models with pairwise potentials. The training task is less general, focusing on conditional random fields with log-linear potentials and a fixed structure. The code is written entirely in R and C++. The initial version is ported from UGM written by Mark Schmidt.

Decoding: Computing the most likely configuration

Inference: Computing the partition function and marginal probabilities

Sampling: Generating samples from the distribution

Training: Given data, computing the most likely estimates of the parameters

Tools: Tools for building and manipulating CRF data


Ling-Yun Wu


J. Lafferty, A. McCallum, and F. Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In the proceedings of International Conference on Machine Learning (ICML), pp. 282-289, 2001.

Mark Schmidt. UGM: A Matlab toolbox for probabilistic undirected graphical models., 2007.


sample.exact(Small$crf, 100)

[Package CRF version 0.4-3 Index]