crf learning framework (not finished yet)