CRF chain implementation