I would like to thank Prof. Sunita Sarawagi for the magical code.
I am referring to the 2001 paper Automatic segmentation of text into structured records by Prof. Sunita Sarawagi and others. A nested(k parallel) crf is used in it and the inner crfs are pruned by merging two parallel chains into one. A self-loop is made on any of the middle nodes in the process, as opposed to having a self loop on the end that is available in the package.
Any help is greatly appreciated.